Hi, I have been sent a .mdf and a .ldf file and I need to use them to create a DB and in the past I have always created a DB by restoring from a .bak file. Can I create the database in EM using the two files or is there a script I can run in QA? Thank you
Check out sp_attach_db in the BOL.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"hahnja peters" <anonymous@.discussions.microsoft.com> wrote in message
news:216ED595-018E-4FEE-9E9D-BA91AA3C7634@.microsoft.com...
Hi, I have been sent a .mdf and a .ldf file and I need to use them to create
a DB and in the past I have always created a DB by restoring from a .bak
file. Can I create the database in EM using the two files or is there a
script I can run in QA? Thank you.
|||Hahnja,
You can attach the mdf and ldf file using sp_attach_db.Refer BooksOnLine for
details.
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"hahnja peters" <anonymous@.discussions.microsoft.com> wrote in message
news:216ED595-018E-4FEE-9E9D-BA91AA3C7634@.microsoft.com...
> Hi, I have been sent a .mdf and a .ldf file and I need to use them to
create a DB and in the past I have always created a DB by restoring from a
..bak file. Can I create the database in EM using the two files or is there a
script I can run in QA? Thank you.
|||you can do both in EM and QA.
in EM first save the files at the desired location, open EM, right click
Databases folder on left pane, click on All Tasks, Attach Database ... then
follow the ziward.
"hahnja peters" <anonymous@.discussions.microsoft.com> wrote in message
news:216ED595-018E-4FEE-9E9D-BA91AA3C7634@.microsoft.com...
> Hi, I have been sent a .mdf and a .ldf file and I need to use them to
create a DB and in the past I have always created a DB by restoring from a
..bak file. Can I create the database in EM using the two files or is there a
script I can run in QA? Thank you.
|||Thank you to everyone for your help. I tried to use EM first, but it wanted me to have the ldf and mdf files on the same drive. So then I used QA and I got it to work. I started off using sp_attach_db but then I read about using CREATE DATABASE in MS Help
and using FOR ATTACH with it - and that worked perfectly. Thank you again for your help.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment