Red Gate forums :: View topic - Drop schema being included in table create script
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK 10
SQL Comparison SDK 10 forum

Drop schema being included in table create script

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
slowcelica



Joined: 15 Feb 2014
Posts: 4

PostPosted: Wed Feb 26, 2014 4:55 pm    Post subject: Drop schema being included in table create script Reply with quote

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:

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]
Back to top
View user's profile Send private message AIM Address
dUros



Joined: 26 Feb 2014
Posts: 6
Location: Slovenija

PostPosted: Thu Feb 27, 2014 7:59 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message AIM Address
slowcelica



Joined: 15 Feb 2014
Posts: 4

PostPosted: Tue Mar 04, 2014 5:29 pm    Post subject: Re: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group