Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Sys columns
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 10/05/2006 :  09:04:19  Show Profile  Reply with Quote
Gurus
In 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 help
Regards
Nitin

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 10/05/2006 :  09:15:54  Show Profile  Reply with Quote
sysobjects contains all objects in the database
syscolumns contains all columns of tables & views


KH

Go to Top of Page

chiragkhabaria
Flowing Fount of Yak Knowledge

India
1907 Posts

Posted - 10/05/2006 :  09:18:57  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
There is a view called information_schema.columns

Chirag
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 10/05/2006 :  09:23:24  Show Profile  Reply with Quote
Thanks
But how wil i find out columns of a particular table?
Regards
Nitin
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 10/05/2006 :  09:35:44  Show Profile  Reply with Quote

use Northwind
select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'Customers'
select name from syscolumns where id = object_id('Customers')



KH

Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 10/05/2006 :  09:56:11  Show Profile  Reply with Quote
Hi
Can you please let me know how will i use this with my update statement in script section?
Thanks
Regards
Nitin
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2167 Posts

Posted - 10/05/2006 :  10:03:46  Show Profile  Reply with Quote
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.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 10/05/2006 :  10:07:04  Show Profile  Reply with Quote
This thread is related to http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=73083


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22864 Posts

Posted - 10/05/2006 :  11:53:21  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
>>Format in the front end! Look in BOL! Ask Peso!

You forget Learn SQL


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000