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 |
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-06-12 : 06:15:04
|
| how can get the column list from SQL query?or how can i get the column names from specific table?thanks in advance,MaheshBMahesh |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2006-06-12 : 06:18:54
|
select c.Name, c.colid from syscolumns cinner join sysobjects oon c.id = o.id and o.xtype = 'u'where o.name = 'Your_table_name'order by c.colidDuane. |
 |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-06-12 : 06:23:43
|
| thanks Duane,BMahesh |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-12 : 06:28:40
|
| Select column_name from Information_Schema.Columnswhere table_name='YourTable'MadhivananFailing to plan is Planning to fail |
 |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2006-06-12 : 06:30:47
|
| thank MadhivananBMahesh |
 |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2006-06-12 : 10:59:09
|
| sp_help tablename will do the trick for you.It will show you the datatype,length everything in it. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-12 : 11:05:12
|
quote: Originally posted by ayamas sp_help tablename will do the trick for you.It will show you the datatype,length everything in it.
Information_Schema.Columns View also has those details MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|