Migration script not detected

AdamYAdamY Posts: 55 Bronze 3
edited February 11, 2013 11:11AM in SQL Compare Previous Versions
I set up my first migration script in SQL Source Control, but need some help determining why SQL Compare won't detect the script. Thank you in advance for any advice you can provide.

SQL Compare version:
SQL Source Control version:
SQL Server 2008 R2
TFS 2010
Example I'm following: Worked Example

+ I have checked in the migration script to source control (TFS).
+ The only difference between what I did and the example is that I created the migration script against "Specific Changes", not "Uncommitted Changes", which means I could not select a specific table like they did in the example. Is that the problem?
+ The script is set to transition the DB from revision 10392 to 10459.
+ I have verified that the Target DB in SQL Compare is on revision 10392 using the "SQLSourceControl Database Revision" extended property on the target DB.
+ In the example above, SQL Compare shows a "Revision: 64" under the "Database" drop-down when setting up the source and target. Mine does not show any "Revision" label at all. What does that mean?


  • Options
    AdamYAdamY Posts: 55 Bronze 3
    I started over so I could tie the migration script to "Specific Changes" (the tables, functions, data, and sprocs). But now SQL Source Control won't let me check in the items - I get this error: TF10141: No files checked in: resolve the conflicts and try again.
    So until I can figure out that problem, I can't continue with my work-around attempt.
  • Options
    AdamYAdamY Posts: 55 Bronze 3
    Well, it took me quite a bit of work to get everything back to a clean state (fix the TF10141 error) but I did. I was then able to link my migration script to "Uncommitted Changes" so I could tie it to 3 specific objects. After I did that, then SQL Compare detected the migration script as desired. So the root issue appears to be:
    In order for SQL Compare to detect the migration script, it seems that the script must be linked to specific object(s) via "Uncomitted Changes", not a pre-committed change (i.e. "Specific Changes").

    I don't remember seeing that in any of the examples or tutorials and it makes me wonder what the purpose is for creating a migration script against "Specific Changes" if the compare process won't see it. Maybe this is a bug? Or more likely I just don't fully understand the process yet.
  • Options
    Correct me if I'm wrong, but it seems that what happened is this:
    • You linked a database to source control
    • You tried to compare the database (with some other database) using SQL Compare and you did not get the migration scripts in as part of the migration
    • After resolving the conflict and committing changes, you got the desired behavior
    This sounds like what it should do, based on that description. SQL Source Control is going to need to get the revision numbers back from the source control system (TFS) in order to set up the migration scripts properly, and it can't do that until some changes were committed first.
  • Options
    AdamYAdamY Posts: 55 Bronze 3
    That is incorrect. The problem was not related to a conflict or uncomitted changes. There were no conflicts and everything was checked in.

    The problem was that when I created the migration script, I had to link it to "Uncommitted Changes" and tie it to specific objects and then commit them all at once. It would not work if I linked the migration script to "Specific Changes" (changes I had already checked in). So it seems SQL Compare will not recognize migration scripts that were linked to "Specific Changes" when they were created/committed.
Sign In or Register to comment.