Monday, March 12, 2012

Login dropped by Transfer Objects Task

Hello all :)
First, sorry for my english but I don't practice everday
So,
I'm a new user of Microsoft SQL 2005 and I'm testing some functionalities in SSIS.

I used the Transfer Objects Task to copy one database to another.
The both db's are on the same instance.

I chose these options for the transfer

-SourceConnection : My_Instance
-SourceDatabase : My_DB
-DestinationConnection : My_Instance
-DestinationDatabase : CopyOfMy_DB
-DropObjectsFirst = True
-IncludeExtendedProperties = Fasle
-CopyData = True
-ExistingData = Replace
-CopySchema = True
-UseCollation = True
IncludeDependentObjects =False
CopyAllObjects = True

The others options are set on FASLE

When I execute the package, I got an error message, the logins are dropped. I cannot connect to the database engine, even with my admin account.
I have to restore the master database !

So my question is : why this SSIS task drop all the logins in sql server in place of just copy one database?

What's the solution for this problem?

Thanks for your comments !

Matt

Nobody knows ?

Matt|||

Hi Matt,

When CopyAllObjects is set to True, the source database and all associated objects are copied -- including logins. When DropObjectsFirst is also to True, SSIS (actually, the underlying SMO layer) attempts to drop all objects (including the logins!) before the copy takes place. Since your source and destination databases are on the same server, this puts the server in a bad state.

While not exactly a bug, this behaviour is a bit dangerous, and there are plans to make the validation "smarter" in the next release to prevent this sort of thing from happening.

To make a copy of your database, you should set CopyAllObjects to False, and set the appropriate fields under ObjectsToCopy to True. (ie. CopyAllTables, CopyAllViews).

Hope that helps!

~Matt

No comments:

Post a Comment