SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Copying database objects


Copying database objects

Author
Message
Rynga
Rynga
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 164
How to copy the database objects (tables, views, Stored procedures, functions, schemas) from one database to another database of different server. Both source and target are SQL server 2008 R2. I just want to copy the database objects and not the actual data. Could somebody please help.
Dird
Dird
SSC-Addicted
SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)

Group: General Forum Members
Points: 461 Visits: 808
Right click Management -> Generate scripts -> select the DB then go through it.

On the objects list it should have "Script Create" as true and "Script Data" as false by default. Select the sp/tables you want then Script it to file and execute that file on the server you want (check it first).

Dird


Dird
Ness
Ness
SSC-Addicted
SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)SSC-Addicted (421 reputation)

Group: General Forum Members
Points: 421 Visits: 974
or you can use the transfer sql objects task in SSIS

SQL DBA
Every day is a school day, and don't trust anyone who tells you any different.
http://sqlblogness.blogspot.co.uk
Ed Wagner
Ed Wagner
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16417 Visits: 10050
If you want everything (data, types, users, security settings, etc.), I found the best way to do it is to take a full backup of the source database and then restore it as a different name. This also allows you to move the backup file from one server to another (for example, a test server) and restore it there. Just another option to consider depending on the situation.


Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Rynga
Rynga
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 164
I tried suing generate scripts.. I was successful in transferring few objects but not all Sad :'(.. It has not copied all the tables.Can someboby please help me more on it
Dird
Dird
SSC-Addicted
SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)

Group: General Forum Members
Points: 461 Visits: 808
ranganathleo (5/13/2013)
It has not copied all the tables.Can someboby please help me more on it


Did you select all the tables you wanted to copy?

Dird


Dird
Rynga
Rynga
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 164
Thanks for the help. The problem was the db was having more than 3000 secondary files. It also had partition functions and schemas. I first copied the partitioned fn's and schemas and was then able to copy the tables using the generate script method.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search