|
Hi, Is there any way to generate the create table script in sql automatically? Example: Say i have 50 tables i dont want to go and find the table script for each table. instead is there a way to generate the create table script automatically. Thanks Satish
(comments are locked)
|
|
You can use SMO with powershell to script all the tables. Here is an article that shows how to script all the views (just replace that with tables): http://philergia.wordpress.com/2011/02/28/using-powershell-and-smo-to-script-sql-server-database-objects-3/
(comments are locked)
|
|
my quick and dirty solution: right click on the database -> Tasks -> Generate Scripts and then go through the wizard It's really the lazy solution regards Dirk
(comments are locked)
|
|
Dirk, Thanks for the reply., actually i just given an example of 50 tables but indeed i have lot of tables to do in that case this solution right click on the database -> Tasks -> Generate Scripts will not work as it takes much more time :) Thanks Satish Ha! I know what you mean. In that case Ken has the better answer. That should fit very well
Jul 31 '12 at 07:42 PM
DirkHondong
(comments are locked)
|
|
Ken, the query is seems to be complex and confusing is there anything easy?
(comments are locked)
|

