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 |
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2006-10-05 : 09:04:19
|
GurusIn the database we have the name of all the objects in syscolumns table,is there any system object from where i can find out the name of all the columns in the table?Plz helpRegardsNitin |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-05 : 09:15:54
|
sysobjects contains all objects in the databasesyscolumns contains all columns of tables & views KH |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-10-05 : 09:18:57
|
There is a view called information_schema.columnsChirag |
|
|
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2006-10-05 : 09:23:24
|
ThanksBut how wil i find out columns of a particular table?RegardsNitin |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-05 : 09:35:44
|
[code]use Northwindselect COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'Customers'select name from syscolumns where id = object_id('Customers')[/code] KH |
|
|
nitin1353
Constraint Violating Yak Guru
381 Posts |
Posted - 2006-10-05 : 09:56:11
|
HiCan you please let me know how will i use this with my update statement in script section?Thanks RegardsNitin |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-10-05 : 10:03:46
|
sounds like another DYNAMIC SQL update. You NEED to know the table name and the column names you are updating BEFORE you do the update, you dont look them up at run time!!! Format in the front end! Look in BOL! Ask Peso! <insert more standard answers here>[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-05 : 11:53:21
|
>>Format in the front end! Look in BOL! Ask Peso! You forget Learn SQL MadhivananFailing to plan is Planning to fail |
|
|
|
|
|