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 |
|
whitebird
Starting Member
12 Posts |
Posted - 2008-03-06 : 08:17:37
|
| Hi, I need a query to get table Definition in sql server 2005. please help me out.Raghu sunkara. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-06 : 08:21:06
|
| Make use of Generate Script option from Management StudioMadhivananFailing to plan is Planning to fail |
 |
|
|
whitebird
Starting Member
12 Posts |
Posted - 2008-03-06 : 08:23:04
|
| Hi Madivanan, Actually i need to get the table definition programatically. so , i need a query to get the table definition. please help me outRegards,Raghu sunkara. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-06 : 08:24:36
|
| sp_help <tablename> |
 |
|
|
johnsql
Posting Yak Master
161 Posts |
Posted - 2008-03-20 : 12:23:46
|
quote: Originally posted by visakh16 sp_help <tablename>
I am afraid the command does not generate script for table defintion as "create table dbo.mytable (...)". Is there an exact way to write such script to get table defintion script as I do using EnterPrise Manager?I am looking for such a script. Thanks. |
 |
|
|
PABluesMan
Starting Member
26 Posts |
Posted - 2008-03-24 : 15:10:31
|
| I would use the [sp_help] system proc and stash the results into a temp table; then write code to loop through the temp table and build the necessary script.Or, you could use a scripting language such as VBScript and use the SQL-DMO object. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-02 : 02:48:13
|
quote: Originally posted by whitebird Hi Madivanan, Actually i need to get the table definition programatically. so , i need a query to get the table definition. please help me outRegards,Raghu sunkara.
You may tryhttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53007MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|