Red Gate forums :: View topic - User, group, or role 'dbo' already exists...
Return to RSS Feed Available

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

User, group, or role 'dbo' already exists...

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message

Joined: 01 Oct 2008
Posts: 1
Location: Malta

PostPosted: Wed Oct 01, 2008 9:19 am    Post subject: User, group, or role 'dbo' already exists... Reply with quote

We are currently doing an evaluation on your SQL Comparison SDK.

We are encountering an issue when executing the following piece of code. We are getting stuck with an exception which we cannot get around for the time being.

The exception below is being raised only when the source database structure is loaded from a file using the code below.


We appreciate your help on this issue please.

Thanks a lot for your help.



private void ExecuteBlock(ExecutionBlock block, Database database_Destination)

//Step 4. Run Script
BlockExecutor executor = new BlockExecutor();

executor.ExecuteBlock(block, database_Destination.ConnectionProperties.ServerName, database_Destination.ConnectionProperties.DatabaseName, false, database_Destination.ConnectionProperties.UserName, database_Destination.ConnectionProperties.Password);

…gives the exception detailed below on the above statement

catch (Exception exception)
throw exception;


- exception {"User, group, or role 'dbo' already exists in the current database."} System.Exception {System.Data.SqlClient.SqlException}

StackTrace " at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)\r\n at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)\r\n at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)\r\n at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)\r\n at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)\r\n at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)\r\n at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()\r\n at RedGate.Shared.SQL.ExecutionBlock.BlockExecutor.ExecuteBlock(ExecutionBlock block, String server, String database, Boolean integratedSecurity, String userName, String password)\r\n at Exigy.SystemFramework.General.SQLDataBase.RedGateUtils.DataBaseCompareUtil.ExecuteBlock(ExecutionBlock block, Database database_Destination)" string

Any help to what this error exactly means would be greatly appreciated.
Back to top
View user's profile Send private message
Michelle Taylor

Joined: 30 Oct 2006
Posts: 529
Location: Red Gate Software

PostPosted: Tue Oct 07, 2008 11:28 am    Post subject: Reply with quote

The error means that the script that was generated by the SDK is trying to create the 'dbo' user.

This shouldn't be happening, but has been previously known to happen with schema synchronization from snapshots.

If you could give a bit more information about how you're generating the script in the first place (what's the other database, what version of Compare did you use to create the snapshot, what SQL Server versions are involved, are you using any non-default options, what's the case sensitivity of the databases in question and the servers they're on), and ideally send me a copy of the troublesome snapshot (to, I'll have a go at tracking down the problem for you.
Back to top
View user's profile Send private message
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