Thursday, March 22, 2012

Copy Database?

I am developing a database at the moment and have reached a point where I
would like to copy the database to another database.
ie. I'm working on database test1 and want to create a database test2 which
is a copy of test1.
Can't work out a simple way to do this although I'm sure I've done it before
(too many late nights, brain is obviously truncating things). Copy wizard
tells me I can't copy to the same server, presumeably because there is no
option to rename the copy.
Can anybody shed some light on this please (no laughing at the simple
question).
thanks
GavGav
BACKUP DATABASE... and then RESTORE with a new name. Please take a look at
BOL for more details
"Gav" <gav@.nospam.com> wrote in message
news:%23jnrIG67HHA.3716@.TK2MSFTNGP03.phx.gbl...
>I am developing a database at the moment and have reached a point where I
>would like to copy the database to another database.
> ie. I'm working on database test1 and want to create a database test2
> which is a copy of test1.
> Can't work out a simple way to do this although I'm sure I've done it
> before (too many late nights, brain is obviously truncating things). Copy
> wizard tells me I can't copy to the same server, presumeably because there
> is no option to rename the copy.
> Can anybody shed some light on this please (no laughing at the simple
> question).
> thanks
> Gav
>|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uO1i%23I67HHA.4736@.TK2MSFTNGP06.phx.gbl...
> Gav
> BACKUP DATABASE... and then RESTORE with a new name. Please take a look
> at BOL for more details
Ha Ha. Cheers for that <feeling silly> :o)
>
> "Gav" <gav@.nospam.com> wrote in message
> news:%23jnrIG67HHA.3716@.TK2MSFTNGP03.phx.gbl...
>>I am developing a database at the moment and have reached a point where I
>>would like to copy the database to another database.
>> ie. I'm working on database test1 and want to create a database test2
>> which is a copy of test1.
>> Can't work out a simple way to do this although I'm sure I've done it
>> before (too many late nights, brain is obviously truncating things). Copy
>> wizard tells me I can't copy to the same server, presumeably because
>> there is no option to rename the copy.
>> Can anybody shed some light on this please (no laughing at the simple
>> question).
>> thanks
>> Gav
>|||You also perform the following alternative methods:
- Take your database offline and copy the mdf and ldf files and rename them.
And then Attach them.
- Detach your database and copy the mdf and ldf files and rename them. And
then Attach all of them.
- Copy your database with Copy Database Wizard. Go to your database right
click on it Tasks\Copy Database
But the easiest one is back and restore anyway :)
--
Ekrem Önsoy
"Gav" <gav@.nospam.com> wrote in message
news:uKhrsP67HHA.5796@.TK2MSFTNGP05.phx.gbl...
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uO1i%23I67HHA.4736@.TK2MSFTNGP06.phx.gbl...
>> Gav
>> BACKUP DATABASE... and then RESTORE with a new name. Please take a look
>> at BOL for more details
> Ha Ha. Cheers for that <feeling silly> :o)
>>
>> "Gav" <gav@.nospam.com> wrote in message
>> news:%23jnrIG67HHA.3716@.TK2MSFTNGP03.phx.gbl...
>>I am developing a database at the moment and have reached a point where I
>>would like to copy the database to another database.
>> ie. I'm working on database test1 and want to create a database test2
>> which is a copy of test1.
>> Can't work out a simple way to do this although I'm sure I've done it
>> before (too many late nights, brain is obviously truncating things).
>> Copy wizard tells me I can't copy to the same server, presumeably
>> because there is no option to rename the copy.
>> Can anybody shed some light on this please (no laughing at the simple
>> question).
>> thanks
>> Gav
>>
>

No comments:

Post a Comment