Scripting users

Forum for users of SQL Toolkit 3,4,and 5

Scripting users

Postby TheBatA » Thu Jan 10, 2008 2:44 pm

I am trying to compare 2 databases, db1 is loaded from a snapshot and db2 is database on local server.
I compared two databases, handled differences (I've selected only different tables, other database objects are deselected) and built work object from differences.
When I try to execute schema block, I get this message:
Code: Select all
  User, group, or role 'dbo' already exists in the current database.

GetString() method from ExecutionBlock object contains next lines:
Code: Select all
CREATE USER [dbo] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]
GO
REVOKE CONNECT FROM [dbo]
GO


I tried to use IgnoreUsers and IgnorePermissions options, but dbo user is still being scripted.
This user exists in both databases.
How can I exclude creation of user [dbo]?

Thanks!
TheBatA
 
Posts: 12
Joined: Tue Sep 25, 2007 8:37 am
Location: Belgrade

Postby Michelle Taylor » Thu Jan 10, 2008 3:22 pm

I'm somewhat confused as to how you've managed to get it attempting to synchronize 'dbo' - I've only come across this previously with different capitalizations of 'dbo' in scripts.

Can you post the code that you're using, or send it to michelle.taylor@red-gate.com so I can have a look at it? I might also need to have a look at the databases themselves to work out why it's trying to synchronize dbo.
Michelle Taylor
 
Posts: 529
Joined: Mon Oct 30, 2006 12:45 pm
Location: Red Gate Software


Return to SQL Toolkit Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests