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.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | babumanStarting 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. |  |  
                                    | jezemineMaster Smack Fu Yak Hacker
 
 
                                    2886 Posts |  |  
                                |  |  |  |