Saturday, February 25, 2012
Copy a database
test things on the copy before I deploy them. So, after I run the copying
SQL, i will have "Northwind" and "Northwind_COPY".
Does anyone have any SQL script for this ?
Thanks,
CraigEasiest way is to backup the database and then restore into and new database
name and of course a
new set of database files. See the BACKUP and RESTORE commands in Books Onli
ne.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Craig HB" <CraigHB@.discussions.microsoft.com> wrote in message
news:C727FC27-A191-4505-B0F6-6B963B96473D@.microsoft.com...
>I want to make a copy of a production database on the same server, so I can
> test things on the copy before I deploy them. So, after I run the copying
> SQL, i will have "Northwind" and "Northwind_COPY".
> Does anyone have any SQL script for this ?
> Thanks,
> Craig|||Hi
Backup and Restore commands (please see for more details in the BOL)
"Craig HB" <CraigHB@.discussions.microsoft.com> wrote in message
news:C727FC27-A191-4505-B0F6-6B963B96473D@.microsoft.com...
> I want to make a copy of a production database on the same server, so I
can
> test things on the copy before I deploy them. So, after I run the copying
> SQL, i will have "Northwind" and "Northwind_COPY".
> Does anyone have any SQL script for this ?
> Thanks,
> Craig|||Assuming you want the data as well, use the Import / Export Wizard (DTS)
and when given the prompt to tell it what to do, select copy data and
objects.
2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.learncsharp.net/home/listings.aspx
"Craig HB" <CraigHB@.discussions.microsoft.com> wrote in message
news:C727FC27-A191-4505-B0F6-6B963B96473D@.microsoft.com...
>I want to make a copy of a production database on the same server, so I can
> test things on the copy before I deploy them. So, after I run the copying
> SQL, i will have "Northwind" and "Northwind_COPY".
> Does anyone have any SQL script for this ?
> Thanks,
> Craig
Friday, February 24, 2012
coping database
hth|||they must be on a separate network i must provide database with my asp.net project to the college so I just copy mdf and log file and then open them with database on enother pc? I do not need to extract it then?|||I think you should detach it before copying.
Or you could make a backup and restore it on the other pc.
Regards
Fredr!k|||(1) stop the sql server.
(2) copy the files to the disc (restart the sql server)
(3) paste them into the c\program files\microsoft sql server\..\data\ folder.
(4) in enterprise manager..attach the files.
pretty simple.
hth|||pretty simple if you know all this technical staff i can not see such option as attach
as it is msde i can access it from Matrix or from Web Data Administrator. The only option i can see is import but that requires sql file