Options

include parameter doesn't handle spaces

philcartphilcart Posts: 45
edited October 17, 2012 7:34AM in SQL Compare Previous Versions
Using SQL Compare command line 10.2.0.1337

I'm using a Powershell script to build up a SQL Compare command line that generates a deployment script for database changes.

One of our developers created an object with a space in the name which has now been changed. SQL Compare treats this as a drop and create.

The command line that is built has the following arguments,
/Scripts1:"C:\Local\Folder" /server2:mySVR1\SQLR2 /database2:myDB /username2:theUser /password2:thePwd /include:Different /Include:Missing /include:StoredProcedure:[myStored Procedure] /include:StoredProcedure:[MyStoredProcedure] /options:DecryptPost2KEncryptedObjects,IgnoreWhiteSpace,IncludeDependencies,IgnoreUserProperties,IgnoreWithElementOrder,IgnoreDatabaseAndServerName,IgnorePermissions,IgnoreUsersPermissionsAndRoleMemberships,ForceColumnOrder,IgnoreUserProperties,AddDatabaseUseStatement /scriptfile:"C:\Temp\theDeployScript.sql" /force /sync

However, this results in the following error,
Error: parsing "[myStored" - Unterminated [] set.

So it appears that even though the object name is enclosed in [] characters, SQL Compare isn't handling the spaces in the object name.


Cheers
Phil

Comments

  • Options
    Thanks for your post.

    I've tested this out and can see what you mean. I think it happens because the square brackets are special characters and need escaping. I tried adding the escape characters, and that seemed to fix it for me. Can you try:
    /include:StoredProcedure:\[myStored Procedure\] /include:StoredProcedure:\[MyStoredProcedure\]
    
    Chris
Sign In or Register to comment.