Data Compare 10.2.0.315 - generated sync script contains err

Compares and synchronizes SQL database content.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

Data Compare 10.2.0.315 - generated sync script contains err

Postby georhill » Tue Jul 03, 2012 6:43 pm

The sync script that is generated by the deployment wizard contains an error when there is a where clause specified on the table during comparison.
Here is the where clause that I specified when I compared the app_code table: "where type = 'prog_degree'"

Here is part of the generated script from the deployment wizard:
-- Update 17 rows in [dbo].[APP_CODE]
UPDATE [dbo].[APP_CODE] SET [OPTION_1]='Level_2', [OPTION_2]='20', [OPTION_3]='ASSOC', [OPTION_4]='Assoc or Tech Level' WHERE [SUBSYSTEM]='CUS' AND [TYPE]='PROG_DEGREE' AND [CODE]='ASSOC' AND (where type = 'prog_degree')
UPDATE [dbo].[APP_CODE] SET [OPTION_1]='Level_3', [OPTION_2]='32', [OPTION_3]='BA_BS', [OPTION_4]='Bachelor Level' WHERE [SUBSYSTEM]='CUS' AND [TYPE]='PROG_DEGREE' AND [CODE]='BA' AND (where type = 'prog_degree')
...

The last "and" clause causes a syntax error in SSMS.
georhill
 
Posts: 13
Joined: Thu Jan 27, 2011 8:31 pm

Postby james.billings » Tue Jul 03, 2012 7:33 pm

When you specify a where clause in SQL Data Compare, don't include the "where" keyword. So in your case it would just be " type = 'prog_degree'"

This is because there's already a where clause added internally by the software so it's working on the right record.
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby georhill » Tue Jul 03, 2012 8:57 pm

Got it! Thanks for the clarification.
georhill
 
Posts: 13
Joined: Thu Jan 27, 2011 8:31 pm


Return to SQL Data Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests