Friday, March 30, 2012

Need to copy a database in the same server without using backup re

Hi,
I need to copy a database 'management' in the same server and name it as management_mid. Is there any command or script to copy the database without
using the backup restore operation? Thanks in advance.Use a DTS package.
Bobby Ryzhy
bobby@. name of domain below
http://www.weekendtech.net
On Tue, 6 Jul 2004 15:34:01 -0700, "Jack"
<Jack@.discussions.microsoft.com> wrote:
>Hi,
>I need to copy a database 'management' in the same server and name it as management_mid. Is there any command or script to copy the database without
>using the backup restore operation? Thanks in advance.|||WHat is wrong with Backup and Restore? You can Restore to a different name
and location. You can also try sp_attach_db.
--
Andrew J. Kelly SQL MVP
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:4B8B3A20-69CC-46F2-A9C3-3009FE770FEE@.microsoft.com...
> Hi,
> I need to copy a database 'management' in the same server and name it as
management_mid. Is there any command or script to copy the database without
> using the backup restore operation? Thanks in advance.|||Hi,
Use this below list of commands, But it require a minutes down time for
actual database.
sp_detach_db management
go
copy the MDF and LDF file for management database to a different folder
go
-- attach the original database management
sp_attach_db
'management','physical_mdf_file_with_path','plysical_ldf_with_path'
go
--attach the new database
sp_attach_db
'management_mid','physical_mdf_file_with_path','plysical_ldf_with_path'
Note:
DTS/BCP are also possible , but will take long time. It requires some manual
tasks as well.
--
Thanks
Hari
MCDBA
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:4B8B3A20-69CC-46F2-A9C3-3009FE770FEE@.microsoft.com...
> Hi,
> I need to copy a database 'management' in the same server and name it as
management_mid. Is there any command or script to copy the database without
> using the backup restore operation? Thanks in advance.

No comments:

Post a Comment