Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Copy a database in SQL Server 2005

Author  Topic 

Tritim
Starting Member

17 Posts

Posted - 2008-05-09 : 12:19:06
Hello all,

I need to copy a database from our production server to my local development machine.

This was easy in SQL 2000, but I'm stumped for SQL 2005. In order to use Management Studio's Database/Tasks/Copy Database feature, I must have SysAdmin rights on not only my local machine, but also on the production server machine. Because there are other important databases on that machine, they won't give me sa rights on the entire production machine.

Someone suggested a two step process:
1. I first script the database
2. Then I use Import/Export Wizard to copy the data.

For scripting, I see that in Management Studio, I can use either Database/Script As, or, I can use Database/Tasks/Generate Scripts. Which is more appropriate? They seem to be very different.

Copying a database seems like a common need. How do other members here do it?

Thanks.

Any thoughts or ideas will be appreciated.



Tritim

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-05-09 : 12:29:04
Ask your DBA to backup and restore in your dev server and give necessary right

You don't need Sysadmin rights to backup database. You just need db_backupoperator role to backup database. Its good to have DBA handle these stuff (fro prod to dev environment)
Go to Top of Page

Tritim
Starting Member

17 Posts

Posted - 2008-05-09 : 12:36:16
Thanks sodeep.
I'm hoping to find a way of doing it from my end so I don't have to make a request from the dba everytime I need a copy. However, I'll start thinking about handling it as you suggest. That may be the only practical way. Thanks.

I'm still curious about how others script or copy a database.

Tritim
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-05-10 : 12:25:30
You still need proper permission to do that even with script.
Go to Top of Page

Tritim
Starting Member

17 Posts

Posted - 2008-06-19 : 20:37:12
Here's a good solution it seems, from Scott Guthrie at Microsoft. He uses the Database Publishing Wizard.

http://weblogs.asp.net/scottgu/archive/2006/12/22/recipe-deploying-a-sql-database-to-a-remote-hosting-environment-part-1.aspx



Tritim
Go to Top of Page

mdubey
Posting Yak Master

133 Posts

Posted - 2008-06-20 : 16:39:40
here is a deal. Only you need to ask to PROD DBA to copy backup file in Dev server and you should be good to go. Or else PROD DBA can keep PROD .bak file in any other location(In That location you should be having access) and again you can copy to your local Dev box start your restoration process.

Manoj
MCP, MCTS
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-20 : 22:37:58
Mdubey,

This has already been addressed before.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-06-21 : 06:57:06
You can use the Copy Database element in SSIS - I use this all the time for various jobs.

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

Tritim
Starting Member

17 Posts

Posted - 2008-06-21 : 13:37:07
Jack,

I hadn't thought about SSIS for this, but that might be a good way for us to go. I'm going to look into that.
Thanks.

Tritim
Go to Top of Page

Tritim
Starting Member

17 Posts

Posted - 2008-06-21 : 14:04:53
Now, unfortunately, it looks like SSIS isn't viable because we're using VS 2008, which doesn't have SSIS ability for SQL 2005. Instead they plan to give it SSIS ability for SQL 2008.

Bad news.

Tritim
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-06-21 : 16:12:20
You can use sql2k5's bids to create ssis package.
Go to Top of Page
   

- Advertisement -