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
 General SQL Server Forums
 New to SQL Server Programming
 system stored procedure to script table

Author  Topic 

Orsla
Starting Member

5 Posts

Posted - 2014-09-30 : 02:18:38
Is it possible to access the procedure which scripts a table to new query?
My goal is to automate the creation of some tables.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2014-09-30 : 02:52:54
Run the profiler to see what goes on behind the scene when you generate script for new table using SSMS.

Harsh Athalye
http://in.linkedin.com/in/harshathalye/
Go to Top of Page

Orsla
Starting Member

5 Posts

Posted - 2014-09-30 : 03:26:52
Very nice idea i checked it but there were no procedures executed :/
Thank you for your help :)
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2014-09-30 : 04:17:37
You can use SMO to automate scripting part.
Have a look at this: [url]http://msdn.microsoft.com/en-us/library/bb511271.aspx[/url]

Harsh Athalye
http://in.linkedin.com/in/harshathalye/
Go to Top of Page

Orsla
Starting Member

5 Posts

Posted - 2014-09-30 : 04:48:22
it gets too complicated for me ;pi guess ill use the sp i made to recreate a table and hope a bug wont show up :D
Go to Top of Page
   

- Advertisement -