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
 Development Tools
 Other Development Tools
 Retrieve script for table object

Author  Topic 

babuman
Starting Member

5 Posts

Posted - 2007-09-30 : 14:04:40
Hi All,

Is there a way to extract the script for an existing database object (table for example) programatically using T-SQL system objects or procedures? I know I can do that using SMO but I am trying to avoid SMO because by the time the process to I generate scripts for every object in a database is executed, I will be old.

Under SSMS, you could right click on a table and select "Script Table as" and write out to a window or file. This is exactly what I want to do, but programatically. Any help please?

Babu.

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-09-30 : 17:13:06
here's an open source console app I wrote that does it using SMO: http://www.codeplex.com/scriptdb




elsasoft.org
Go to Top of Page
   

- Advertisement -