Monday, February 13, 2012

Attaching database

I have an SQL server going on my Notebook.
I want to move it to another location and then reattach it.
I have forgotten how to get to the commandwindow where I can start with EXEC
....
reidarTDo you have QA installed on yuor laptop?
BOL says
This example detaches the pubs database with skipchecks set to true.
EXEC sp_detach_db 'pubs', 'true'
--This example attaches two files from pubs to the current server.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'
"reidarT" <reidar@.eivon.no> wrote in message
news:eO%23dBlvKGHA.964@.tk2msftngp13.phx.gbl...
>I have an SQL server going on my Notebook.
> I want to move it to another location and then reattach it.
> I have forgotten how to get to the commandwindow where I can start with
> EXEC ....
> reidarT
>|||Here is an eg from BOL
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'
--
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com
"reidarT" <reidar@.eivon.no> wrote in message
news:eO%23dBlvKGHA.964@.tk2msftngp13.phx.gbl...
>I have an SQL server going on my Notebook.
> I want to move it to another location and then reattach it.
> I have forgotten how to get to the commandwindow where I can start with
> EXEC ....
> reidarT
>

No comments:

Post a Comment