Home > Archive > MS SQL Server > February 2006 > Attaching database









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Attaching database
reidarT

2006-02-06, 3:23 am

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


Uri Dimant

2006-02-06, 3:23 am

Do 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\pu
bs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pu
bs_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
>



Roji. P. Thomas

2006-02-06, 3:23 am

Here is an eg from BOL

EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pu
bs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL
Server\MSSQL\Data\pu
bs_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
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com