Drop schema being included in table create script

Automate and integrate using the SQL comparison API

Moderators: Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

Drop schema being included in table create script

Postby slowcelica » Wed Feb 26, 2014 4:55 pm

I am using sql compare sdk 10 to compare 2 databases and in the source database i have 6 objects that don't exist in the target. Three tables & three sp's, in the target there are 2 tables and 1 schema that does not exist in the source, which is ok I don't want them removed. At the bottom of each script that gets generated there is this,

Code: Select all
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
PRINT N'Dropping schemata'
GO
DROP SCHEMA [Test]


I don't want this schema to be dropped and i don't know why it would it has nothing to do with the table or sp being created. If I use sql compare it is not in the generated scripts.

Is there some option that is causing this that I need to include? I'm using the same options that are the default in sql compare in my code.[/code]
slowcelica
 
Posts: 4
Joined: Sat Feb 15, 2014 12:08 am

Postby dUros » Thu Feb 27, 2014 7:59 pm

Hello

Look my post "Exclude Logins, Users and Shemas". I think that is the solution for your problem too.

Use loop I mentioned:

.
.
If difference.DatabaseObjectType.ToString = "Schema" Then
difference.Selected = False
Else
difference.Selected = True
.............
Endif
.
.

Regards
dUros
 
Posts: 6
Joined: Wed Feb 26, 2014 11:09 am
Location: Slovenija

Re:

Postby slowcelica » Tue Mar 04, 2014 5:29 pm

dUros wrote:Hello

Look my post "Exclude Logins, Users and Shemas". I think that is the solution for your problem too.

Use loop I mentioned:

.
.
If difference.DatabaseObjectType.ToString = "Schema" Then
difference.Selected = False
Else
difference.Selected = True
.............
Endif
.
.

Regards


Thanks, yea I figured it out, that was kind of the problem. I was only setting certain differences to selected = false. Thanks.
slowcelica
 
Posts: 4
Joined: Sat Feb 15, 2014 12:08 am


Return to SQL Comparison SDK 10

Who is online

Users browsing this forum: No registered users and 0 guests