Red Gate forums :: View topic - Data Compare 10.2.0.315 - generated sync script contains err
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare 10
SQL Data Compare 10 forum

Data Compare 10.2.0.315 - generated sync script contains err

Search in SQL Data Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
georhill



Joined: 27 Jan 2011
Posts: 13

PostPosted: Tue Jul 03, 2012 6:43 pm    Post subject: Data Compare 10.2.0.315 - generated sync script contains err Reply with quote

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.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1116
Location: My desk.

PostPosted: Tue Jul 03, 2012 7:33 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
georhill



Joined: 27 Jan 2011
Posts: 13

PostPosted: Tue Jul 03, 2012 8:57 pm    Post subject: Reply with quote

Got it! Thanks for the clarification.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group