How to attach and detach databases in MSDE?

How to attach and detach databases in MSDE?
LVL 9
Jerry_PangAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ram2098Connect With a Mentor Commented:
you can detatch the files using ...

EXEC sp_detach_db 'databasename'

You can attach using....

EXEC sp_attach_db @dbname = N'pubs',
   @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',
   @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.