Use "Add object existence checks" from commandline

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Use "Add object existence checks" from commandline

Postby stephenk » Thu Mar 29, 2012 3:00 pm

How do I use the "Add object existence checks" and "Use DROP and CREATE instead of ALTER" options from the command line
stephenk
 
Posts: 3
Joined: Fri Feb 24, 2012 11:47 am

Postby Brian Donahue » Mon Apr 02, 2012 11:29 am

All of the options for the SQL Compare command line are noted here:
http://www.red-gate.com/supportcenter/C ... ne_Options
It looks as if the documentation is out of date, though. I will get that looked into.

You would use /options:ObjectExistenceChecks,DropAndCreateInsteadOfAlter to accomplish what you want to do. For a shorter command-line, you could use the aliases for these options: oec and dacia respectively.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby stephenk » Mon Apr 02, 2012 12:12 pm

Thanks.

The new options switches are also missing from SQLCompare.exe /? and SQLCompare.exe /verbose /? commandline help.
stephenk
 
Posts: 3
Joined: Fri Feb 24, 2012 11:47 am

Postby Brian Donahue » Mon Apr 02, 2012 2:25 pm

Odd, because I found thouse options the way I described... at least in version 10.1.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

re: error when using oec and dacia options

Postby stephenk » Tue Apr 03, 2012 9:57 am

I tried the switches oec and dacia but I get the following error:

SQL Compare Command Line V10.0.0.143
============================
Copyright © Red Gate Software Ltd 1999-2011

Error: Invalid value for switch /options: oec. Please use SQLCompare.exe /? or SQLCompare.exe /verbose /? for more information.

I also tried the full switch names, ObjectExistenceChecks and DropAndCreateInsteadOfAlter, but got the same error.

note the version downloaded from web is 10.0.0.143, not 10.1
stephenk
 
Posts: 3
Joined: Fri Feb 24, 2012 11:47 am

Postby David Atkinson » Tue Apr 03, 2012 10:23 am

If you use Check for Updates in the tool (Help menu), it will download v10.1. This version will appear on the main download soon.

Apologies for this.

David Atkinson
Red Gate
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

Postby Taras B » Sat Jun 01, 2013 3:13 pm

Hi

It seems ObjectExistenceChecks is always on in SQL Compare 10.2 when generating deployment script with command line. I'm using these options:

/Project:Core_rollout.scp /Scriptfile:Scripts\\Rollout_2_Auto_Gen_Schema.sql /Force /ScriptEncoding:ASCII /Options:None,DecryptPost2KEncryptedObjects,IgnoreDatabaseAndServerName,IgnoreFileGroups,IgnoreFillFactor,IgnoreIndexLockProperties,IgnoreNotForReplication,IgnorePermissions,IgnoreReplicationTriggers,IgnoreStatistics,IgnoreUserProperties,IgnoreUsers,IgnoreWhiteSpace,IgnoreWithElementOrder,IgnoreWithNocheck,IgnoreConstraintNames,DisableSOCForLiveDBs,IgnoreStatisticsNorecompute,NoTransactions

and it always inserts existance checks.

The reason why I am trying to disable check is that SQL Compare generates strange name for bindings in the existance check part:
...AND default_object_id = OBJECT_ID(N'[dbo].[[dbo]].[D_FlagFalse]]]', 'D'))
which doesn't work

Any ideas how to get rid of any of those 2 issues?

Kind regards
Taras
Taras B
 
Posts: 3
Joined: Sat Jun 01, 2013 3:04 pm

Postby Taras B » Sat Jun 01, 2013 3:19 pm

Small addition to my previous post: seems ObjectExistenceChecks in my case comes from the .scp file and is not overriden by command line.
Taras B
 
Posts: 3
Joined: Sat Jun 01, 2013 3:04 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest