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 |
|
dvanatta
Starting Member
6 Posts |
Posted - 2009-06-04 : 17:19:54
|
| I am getting the script of views using the following SQL:SELECT sc.text FROM MyDBName.dbo.sysobjects so INNER JOIN MyDBName.dbo.syscomments sc ON so.id = sc.id WHERE so.name=N'MyViewName'Views, Stored Procs, trigger scripts are stored in syscomments.Text but not Tables.Where can I find the Table Script?Thanks. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-06-04 : 17:26:26
|
| Tables are not compiled code so the "parsed" script definition is not stored like the other objects you mention.You would have to generate the script either using the built in scripting functionality or construct your own "generator" by selecting out of a bunch of system tables (or information_schema views)Be One with the OptimizerTG |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
|
|
|
|