Saturday, February 25, 2012

.ndf

Is there a way to attach an .ndf file from database A to database B and move whatever tables and indexes in the data file to database B?You can do it using SP_ATTACH_DB, for instance :
[/B]
EXEC sp_attach_db @.dbname = N'MyDB',
@.filename1 = N'F:\mssql7\data\My_Data.mdf',
@.filename2 = N'F:\mssql7\data\My_Data.Ndf',
@.filename3 = N'F:\mssql7\data\My_log.ldf'
[/B]
Refer to books online for more information on the SP.

No comments:

Post a Comment