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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 get columns

Author  Topic 

putane.sanjay
Yak Posting Veteran

77 Posts

Posted - 2007-01-03 : 09:04:32
Hi
How to find how many columns in the table through tsql
please suggest me

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-03 : 09:22:00
Ever heard of INFORMATION_SCHEMA views?

select count(*) from information_schema.columns where table_name = 'tbl1'


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

putane.sanjay
Yak Posting Veteran

77 Posts

Posted - 2007-01-04 : 05:23:41
IAM NEW TO SQL DBA

Thank u
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-01-06 : 02:20:41

or

sp_columns 'TableName'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2007-01-06 : 11:48:16
Putane,

Just a thought... "New to SQL" and "DBA" are mutually exclusive terms and will set YOU up for less probability of success than the intersection of two very large random numbers... If you call yourself a DBA, people will really put you on the spot and you will very quickly get in over your head. "DBA" is not a simple term for anyone working with SQL.

--Jeff Moden
Go to Top of Page
   

- Advertisement -