Wednesday, March 21, 2012

From SQL Server to MSDE

I have an SQL Server .MDF and .LDF file. The files were created a while ago and backed up. Well I need to use the database again, however I can't use SQL Server. So my next solution is MSDE.

How to I create a new database in MSDE using the already created .MDF and .LDF files as the actual database?sp_attach_db will allow you to fo the attach from SQL:


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'

No comments:

Post a Comment