Showing posts with label completes. Show all posts
Showing posts with label completes. Show all posts

Friday, March 9, 2012

problem with DtsTransferProvider

I am trying to transfer a database from one SQL Server 2005 server to another. TransferData method completes successfully (and all tables are available in the destination) if the source db contains only default database users (namely dbo, guest, sys). Then I repeated the same process after adding a database user (named 'testdbuser') to the source database, TransferData method threw the following exception, but the database was created in the destination (tables were not available in the destination)
ERROR : errorCode=-1073548784 description=Executing the query "CREATE USER [testdbuser] FOR LOGIN [BUILTIN\Admini..." failed with the following error: "User, group, or role 'testdbuser' already exists in the current database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

The stack trace was:
StackTrace = " at Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer()\r\n at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()\r\n at SMOTransferTest.MyTransfer.TransferDB() ...

This exception is thrown by DtsTransferProvider. I have SSIS installed in my machine and I guess probably that is causing this issue.

Is this a known issue?

I am not explicitly referencing DtsTransferProvider in my project. It references Microsoft.SqlServer.ConnectionInfo.dll and Microsoft.SqlServer.Smo.dll. So, I am not sure why calling TransferData method in the transfer object results in an exception thrown by DtsTransferProvider.

What login is 'testdbuser' mapped to?
Who is the owner of the source database\transferred database?

If I map a 'testuser' to the 'Builtin\Adminstrators' login when adding to the source database and then transfer the database the following error is received:

ERROR : errorCode=-1073548784 description=Executing the query “CREATE USER [testuser] FOR LOGIN [BUILTIN\Administrators]
“failed with the following error: “The login already has an account under a different user name.”.
Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly.

I don't get this error if the user is added to the database mapped to eg a SQL login 'testuser'.

Ian Dutton

|||

By defaulty transfer does not use IF NOT EXISTS statement when scripting out objects to the target database. If a role already exists in the target it will fail. However you can transfer the roles separately using the t ransfer.CopyAllRoles = true & transfer.Options.IncludeIfNotExists = true settings.

SSIS is used internally to carry out the actual transfer of tables.

jkh

|||Thanks for your response.

I assume you are referring to the "database role" and not "server role".

In my case the "database role" did not exist already because the database was available in the source server only. I was *not* trying to transfer parts of a database to the destination server but I was trying to copy the *entire* database to the destination server. So, the database (or "database role" in that database for that matter) was not present at the destination to start with. When attempting to copy the entire database, I assumed that "database users" and "database roles" would be copied along with other database objects. However, I am getting an error message that says "database user" already exists at the destination. Apparently, this message is thrown while trying to create the database users at the destination.

My question is: why does "CREATE USER" command fails when the database (now available at the destination server) does not have the "database user"?

As I have mentioned in my previous post, in spite of the exception, I could see the database (at the destination server) which, I guess, is nothing but the "model" database in the destination without any tables, views, "database users" or any other database object from the source.|||Within SSIS Database Transfer Task, where do I specify these parameters? I am getting the same errors.|||

Can you please furnish a full example?

This is becoming extremely annoying... nothing works as it should in SSIS when it comes to moving data between databases (short of backup-restore from backup), and any answers we (the users) get, are incomplete. Definitely not the way to go.

problem with DtsTransferProvider

I am trying to transfer a database from one SQL Server 2005 server to another. TransferData method completes successfully (and all tables are available in the destination) if the source db contains only default database users (namely dbo, guest, sys). Then I repeated the same process after adding a database user (named 'testdbuser') to the source database, TransferData method threw the following exception, but the database was created in the destination (tables were not available in the destination)
ERROR : errorCode=-1073548784 description=Executing the query "CREATE USER [testdbuser] FOR LOGIN [BUILTIN\Admini..." failed with the following error: "User, group, or role 'testdbuser' already exists in the current database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

The stack trace was:
StackTrace = " at Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer()\r\n at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()\r\n at SMOTransferTest.MyTransfer.TransferDB() ...

This exception is thrown by DtsTransferProvider. I have SSIS installed in my machine and I guess probably that is causing this issue.

Is this a known issue?

I am not explicitly referencing DtsTransferProvider in my project. It references Microsoft.SqlServer.ConnectionInfo.dll and Microsoft.SqlServer.Smo.dll. So, I am not sure why calling TransferData method in the transfer object results in an exception thrown by DtsTransferProvider.

What login is 'testdbuser' mapped to?
Who is the owner of the source database\transferred database?

If I map a 'testuser' to the 'Builtin\Adminstrators' login when adding to the source database and then transfer the database the following error is received:

ERROR : errorCode=-1073548784 description=Executing the query “CREATE USER [testuser] FOR LOGIN [BUILTIN\Administrators]
“failed with the following error: “The login already has an account under a different user name.”.
Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly.

I don't get this error if the user is added to the database mapped to eg a SQL login 'testuser'.

Ian Dutton

|||

By defaulty transfer does not use IF NOT EXISTS statement when scripting out objects to the target database. If a role already exists in the target it will fail. However you can transfer the roles separately using the t ransfer.CopyAllRoles = true & transfer.Options.IncludeIfNotExists = true settings.

SSIS is used internally to carry out the actual transfer of tables.

jkh

|||Thanks for your response.

I assume you are referring to the "database role" and not "server role".

In my case the "database role" did not exist already because the database was available in the source server only. I was *not* trying to transfer parts of a database to the destination server but I was trying to copy the *entire* database to the destination server. So, the database (or "database role" in that database for that matter) was not present at the destination to start with. When attempting to copy the entire database, I assumed that "database users" and "database roles" would be copied along with other database objects. However, I am getting an error message that says "database user" already exists at the destination. Apparently, this message is thrown while trying to create the database users at the destination.

My question is: why does "CREATE USER" command fails when the database (now available at the destination server) does not have the "database user"?

As I have mentioned in my previous post, in spite of the exception, I could see the database (at the destination server) which, I guess, is nothing but the "model" database in the destination without any tables, views, "database users" or any other database object from the source.|||Within SSIS Database Transfer Task, where do I specify these parameters? I am getting the same errors.|||

Can you please furnish a full example?

This is becoming extremely annoying... nothing works as it should in SSIS when it comes to moving data between databases (short of backup-restore from backup), and any answers we (the users) get, are incomplete. Definitely not the way to go.

problem with DtsTransferProvider

I am trying to transfer a database from one SQL Server 2005 server to another. TransferData method completes successfully (and all tables are available in the destination) if the source db contains only default database users (namely dbo, guest, sys). Then I repeated the same process after adding a database user (named 'testdbuser') to the source database, TransferData method threw the following exception, but the database was created in the destination (tables were not available in the destination)
ERROR : errorCode=-1073548784 description=Executing the query "CREATE USER [testdbuser] FOR LOGIN [BUILTIN\Admini..." failed with the following error: "User, group, or role 'testdbuser' already exists in the current database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

The stack trace was:
StackTrace = " at Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer()\r\n at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()\r\n at SMOTransferTest.MyTransfer.TransferDB() ...

This exception is thrown by DtsTransferProvider. I have SSIS installed in my machine and I guess probably that is causing this issue.

Is this a known issue?

I am not explicitly referencing DtsTransferProvider in my project. It references Microsoft.SqlServer.ConnectionInfo.dll and Microsoft.SqlServer.Smo.dll. So, I am not sure why calling TransferData method in the transfer object results in an exception thrown by DtsTransferProvider.

What login is 'testdbuser' mapped to?
Who is the owner of the source database\transferred database?

If I map a 'testuser' to the 'Builtin\Adminstrators' login when adding to the source database and then transfer the database the following error is received:

ERROR : errorCode=-1073548784 description=Executing the query “CREATE USER [testuser] FOR LOGIN [BUILTIN\Administrators]
“failed with the following error: “The login already has an account under a different user name.”.
Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly.

I don't get this error if the user is added to the database mapped to eg a SQL login 'testuser'.

Ian Dutton

|||

By defaulty transfer does not use IF NOT EXISTS statement when scripting out objects to the target database. If a role already exists in the target it will fail. However you can transfer the roles separately using the t ransfer.CopyAllRoles = true & transfer.Options.IncludeIfNotExists = true settings.

SSIS is used internally to carry out the actual transfer of tables.

jkh

|||Thanks for your response.

I assume you are referring to the "database role" and not "server role".

In my case the "database role" did not exist already because the database was available in the source server only. I was *not* trying to transfer parts of a database to the destination server but I was trying to copy the *entire* database to the destination server. So, the database (or "database role" in that database for that matter) was not present at the destination to start with. When attempting to copy the entire database, I assumed that "database users" and "database roles" would be copied along with other database objects. However, I am getting an error message that says "database user" already exists at the destination. Apparently, this message is thrown while trying to create the database users at the destination.

My question is: why does "CREATE USER" command fails when the database (now available at the destination server) does not have the "database user"?

As I have mentioned in my previous post, in spite of the exception, I could see the database (at the destination server) which, I guess, is nothing but the "model" database in the destination without any tables, views, "database users" or any other database object from the source.|||Within SSIS Database Transfer Task, where do I specify these parameters? I am getting the same errors.|||

Can you please furnish a full example?

This is becoming extremely annoying... nothing works as it should in SSIS when it comes to moving data between databases (short of backup-restore from backup), and any answers we (the users) get, are incomplete. Definitely not the way to go.