Tuesday, March 27, 2012

Attach database in sql 2005

I detached a db to copy it and to my surprise i cant reattach it the same way i detached ... How do i do this?use master
go
sp_attach_db 'CompanyTbl','C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DMS_Data.mdf',
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DMS_Log.ldf'
go

No comments:

Post a Comment