Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
T-SQL (SS2K8)
»
Is it possible to create a script that will...
Is it possible to create a script that will generate a create table script for all tables in a database at once?
Rate Topic
Display Mode
Topic Options
Author
Message
dndaughtery
dndaughtery
Posted Friday, November 09, 2012 11:09 AM
SSC Veteran
Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 234,
Visits: 516
Say I have a database called MyDB with 100 tables. I need to create these tables on another db. Is there a TSQL script that will return the create table scripts for all tables on MyDB?
Post #1383156
dndaughtery
dndaughtery
Posted Friday, November 09, 2012 11:24 AM
SSC Veteran
Group: General Forum Members
Last Login: Yesterday @ 12:22 PM
Points: 234,
Visits: 516
I ended up using the Transfer SQL Server Objects task in ssis to copy the tables over without the data which is exactly what I needed.
Post #1383164
Luis Cazares
Luis Cazares
Posted Friday, November 09, 2012 11:27 AM
SSC Eights!
Group: General Forum Members
Last Login: Yesterday @ 7:51 PM
Points: 958,
Visits: 1,919
In SSMS you can right click on the database and use Tasks-> Generate Scripts...
That will give you plenty of options to generate the scripts for all or some of the objects of your database.
Luis C.
Please don't trust me, test the solutions I give you before using them.
Forum Etiquette: How to post data/code on a forum to get the best help
Post #1383165
vinu512
vinu512
Posted Monday, November 12, 2012 2:22 AM
Ten Centuries
Group: General Forum Members
Last Login: Yesterday @ 12:37 AM
Points: 1,047,
Visits: 1,439
You can use the Genereate Scripts option as shown in the following link:
Generating Scripts in sql server
Vinu Vijayan
For better and faster solutions please check...
"How to post data/code on a forum to get the best help" - Jeff Moden
Post #1383558
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.