Can't /exclude:table
jhogan
Posts: 9
I'm having a pretty straightforward problem. I can't exclude tables using the command line tool. I can exclude stored procedures though. Here is my command:
I'm using 8.1.0.360
I'm I misunderstanding something?
I've tried with several other tables too.
Thanks in advance for your help.
SQLCompare.exe /database1:mydb1 /database2:mydb2/scriptfile:"C:\out.sql" /exclude:table:mytblBuried in c:\out.sql is DDL I would expect if the table were not excluded:
PRINT N'Altering [dbo].[mytbl]' GO ALTER TABLE [dbo].[mytbl] ADD [mycol] [int] NULL GO IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION GO IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END GO ALTER TABLE [dbo].[mytbl] DROP COLUMN [mycol2] GO IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION GO IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END GO
I'm using 8.1.0.360
I'm I misunderstanding something?
I've tried with several other tables too.
Thanks in advance for your help.
Comments
From the example code, you have not specified any options therefore by default, the default options are set which includes the 'Include Dependencies' option. The list of default options are as follows:
DecryptPost2KEncryptedObjects IgnoreFillFactor IgnoreWhiteSpace IncludeDependencies IgnoreFileGroups IgnoreUserProperties IgnoreWithElementOrder
I suspect that the table you wish to exclude has dependencies to other objects in the database hence why the table has not been excluded from the synchronization script.
If you not wish to use the default options you must select at least one option, using the /options switch. For example:
In my example the options will ignore any white space and ignore triggers. The default options will not used.
The SQL Compare Help file contains the full list of available options that can be specified using the command line.
Hope the above helps.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
If I could make a recommendations I would suggest adding this caveat to the /exclude section of the help file because I spent quite a while playing with this trying to get it to work.
Anyway, thanks.
I submitted a feature request for the SQL Compare Development Team to consider, making the information regarding the default options for the comand line Interface more prominent.
The reference number for this request is SC-4642.
I cannot guarantee the success of the request submitted, however if approval is given you will hopefully see it in a future version of the documentation.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com