--HOW TO ATTACH AND DETACH DATABASE FILES
select * from sys.database_files
--read the physical_name of current location of the database before detach
EXEC SP_DETACH_DB N'DATABASENAME'
--database is detached so now go to the loction where the (mdb,ldb) file is located and move to new location copy that new location
EXEC SP_ATTACH_DB N'DATABASENAME' , 'NEW_LOCATION_DATA.mdb', 'NEW_LOCATION_LOG.ldb'
--run the below commant to see the new changes
SELECT * FROM SYS.DATABASE_FILES
No comments:
Post a Comment