I am trying to use SQLDMO to migrate files on an already created database. It is important that the database remains intact (security settings, backup schedules, etc.)

The AttachDB looks like it is what I would need to do this, but the documentation says:

"The AttachDB method fails if more than 16 OS files are specified. When using SQL-DMO to move a database implemented on more than 16 files, use the CreateForAttach property of a Database object."

When looking at the CreateForAttach property, it says:

"Note: CreateForAttach can only be set when the database is initially created."

This note confuses me, as all I want to do is re-attach a database that has (potentially) more than 16 OS files.

Any ideas on what I need to do to handle the migration properly? And if I need to do something with CreateForAttach, how do I go about doing all of this?

Here is what I was basically planning on doing...

m_sqlServer.DetachDB(database, false);
// Get the appropriate sqlDatabase object and change the DB and Log
// Paths
sqlDatabase.CreateForAttach = true;
m_sqlServer.AttachDB(database, ???);

Thanks for any help!

Charlie Becker