I've got a database from SQL Server 2005 that I am programmatically attaching to an instance of SQL Server 2008 R2, then re-establishing replication on some tables (via some pre-baked scripts that have worked for a small lifetime) with another server still running SQL Server 2005.
Suffice it to say it's just a particularly convoluted business requirement.
Interestingly enough, the replication fails on a particular SQL Server Agent job with an error "Invalid column name 'originator id'". From what I can understand from this link: http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_24145417.html - the older database needs to have various bits and pieces upgraded to work correctly with SQL Server 2008 R2's replication. That upgrade process is as simple as running the stored procedure sp_vupgrade_replication: http://technet.microsoft.com/en-us/library/ms188741.aspx
Question 1: Why is there ANY information about replication baked into the database I am attaching?! My understanding was that the distribution database contained the entirety of replication information. I have deleted and re-attached a non-upgraded copy of the database to make sure it still didn't work to make sure I wasn't going insane.
Question 2: I know there are some procedures that get executed to upgrade the database to a certain compatibility level when you attach a DB to a newer version of SQL Server. Why isn't this stored procedure run?
Question 3: What exactly is this stored procedure changing? Is there any way I can find out any more than the MSDN article is offering me? I haven't tried it, but I'm pretty sure SQL Profiler will just tell me that it is executing sp_vupgrade_replication and not give me any details of the queries it is running.