/sync fails with invalid syntax, but /scriptfile works fine
andersom
Posts: 29
I'm having some command line scripting issues. Specifically, I am issuing the following command line:
And recieving the error:
However when I remove the /sync from the command and replace it with /scriptfile:out.sql, I can then run the out.sql without error in a SQL Management Studio query window.
Is this a known issue? I'm currently using SQL Compare Command Line V6.0.0.1410
SQLCompare.exe /verbose /exclude:user /exclude:role /exclude:schema /options:iw,iweo,iu,iup,irpt /server1:the_real_trsprodk /server2:ladbtrsmo01\latrsmom /database1:cms_warehouse /database2:cms_warehouse /sync
And recieving the error:
Error: Error Comparing the_real_trsprodk/cms_warehouse vs ladbtrsmo01\latrsmom/cms_warehouse : Incorrect syntax near the keyword 'create'. Incorrect syntax near 'end'.
However when I remove the /sync from the command and replace it with /scriptfile:out.sql, I can then run the out.sql without error in a SQL Management Studio query window.
Is this a known issue? I'm currently using SQL Compare Command Line V6.0.0.1410
Comments
Can you please post the entire output so that we can see at what point the error occurred? You can truncate the object list within the output if it is too long.
Thanks,
Jonathan
-Project Manager
-Red Gate Software Ltd
that's with the verbose option. Is there a debug option that I could use that would give more output?
Does this work with the UI synchronising? If it does fail in the UI what object and object type does it fail on?
I understand that this isn't always possible, but is it going to be possible to provide snapshots of the databases in question?
Regards,
Jonathan
-Project Manager
-Red Gate Software Ltd
Note that this occurs on multiple DBs in our environment. I'm not sure if all of the errors occur on replication procs as above though.
Okay, I can see the problem, you have a numbered stored procedure.
Unfortunately this is a limitation within the SQL Compare engine, whilst SQL Compare can compare numbered stored procedures the execution of scripts containing them fails as the execution block cannot contain a GO batch delimiter which between the two parts of the stored procedure.
Currently the only workaround is to execute the script manually.
Regards,
Jonathan
-Project Manager
-Red Gate Software Ltd