Hi Folks
I am a newbie trying to attach an MSDE dbf from a whatever.mdf and
whatever.ldf files. I keep getting an error that I can't attach the database
to the same name as an existing database.
Any help would be appreciated?
Danny
Hello,
Looks like the database name you specify in the atatch database is already
in the same server instance. Execute SP_HELPDB and make sure that
the database you specy is already not there.
Thanks
Hari
"Danny" <lane.dj@.gmail.com> wrote in message
news:OZdKYqZaHHA.1220@.TK2MSFTNGP03.phx.gbl...
> Hi Folks
> I am a newbie trying to attach an MSDE dbf from a whatever.mdf and
> whatever.ldf files. I keep getting an error that I can't attach the
> database to the same name as an existing database.
> Any help would be appreciated?
> Danny
>
Showing posts with label folksi. Show all posts
Showing posts with label folksi. Show all posts
Tuesday, March 27, 2012
Sunday, March 25, 2012
Attach database
Hi folks
I have copied a .mdf file from machine1 (without detaching it)
Can I attach it to a SQL Server which is running on a different machine
(machine2)? If not, is there anyother way to restore the database with
the .mdf file (without using the backup)?
Thanks in advance.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!I gather you stopped the SQL service first to do the copy without detaching
the database.
I would recommend using a backup but if you want to do it this way you can
use EM, right click on databases > attach database
OR TSQL
EXEC sp_attach_db 'MyDb', 'C:\MyDirectory\MyDb_Data.mdf',
'C:\MyDirectory\MyDb_Log.ldf'
Andy
"Venkatesan M" wrote:
> Hi folks
> I have copied a .mdf file from machine1 (without detaching it)
> Can I attach it to a SQL Server which is running on a different machine
> (machine2)? If not, is there anyother way to restore the database with
> the .mdf file (without using the backup)?
> Thanks in advance.
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
>|||The only way to gaurantee an attach is when the db files are properly
detached first (without open tran). In your case you could try with
e.g.
sp_attach_single_file_db 'db_name',N'mdf file path'
-oj
"Venkatesan M" <venkat_asp@.yahoo.co.uk> wrote in message
news:%23FJfMrDBFHA.2180@.TK2MSFTNGP12.phx.gbl...
> Hi folks
> I have copied a .mdf file from machine1 (without detaching it)
> Can I attach it to a SQL Server which is running on a different machine
> (machine2)? If not, is there anyother way to restore the database with
> the .mdf file (without using the backup)?
> Thanks in advance.
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
I have copied a .mdf file from machine1 (without detaching it)
Can I attach it to a SQL Server which is running on a different machine
(machine2)? If not, is there anyother way to restore the database with
the .mdf file (without using the backup)?
Thanks in advance.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!I gather you stopped the SQL service first to do the copy without detaching
the database.
I would recommend using a backup but if you want to do it this way you can
use EM, right click on databases > attach database
OR TSQL
EXEC sp_attach_db 'MyDb', 'C:\MyDirectory\MyDb_Data.mdf',
'C:\MyDirectory\MyDb_Log.ldf'
Andy
"Venkatesan M" wrote:
> Hi folks
> I have copied a .mdf file from machine1 (without detaching it)
> Can I attach it to a SQL Server which is running on a different machine
> (machine2)? If not, is there anyother way to restore the database with
> the .mdf file (without using the backup)?
> Thanks in advance.
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
>|||The only way to gaurantee an attach is when the db files are properly
detached first (without open tran). In your case you could try with
e.g.
sp_attach_single_file_db 'db_name',N'mdf file path'
-oj
"Venkatesan M" <venkat_asp@.yahoo.co.uk> wrote in message
news:%23FJfMrDBFHA.2180@.TK2MSFTNGP12.phx.gbl...
> Hi folks
> I have copied a .mdf file from machine1 (without detaching it)
> Can I attach it to a SQL Server which is running on a different machine
> (machine2)? If not, is there anyother way to restore the database with
> the .mdf file (without using the backup)?
> Thanks in advance.
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
Subscribe to:
Posts (Atom)