how to find number of columns in a table in sql server 2000
and 2005 also
Answer Posted / anand k
--Count of Columns
SELECT COUNT(*) NO_OF_COLUMNS
FROM SYS.COLUMNS
WHERE OBJECT_ID = OBJECT_ID('<TableName>')
ORDER BY Column_ID
--Column Names
SELECT [NAME]
FROM SYS.COLUMNS
WHERE OBJECT_ID = OBJECT_ID('<TableName>')
ORDER BY Column_ID
| Is This Answer Correct ? | 14 Yes | 6 No |
Post New Answer View All Answers
Explain the difference between control flow and data flow?
how you can deploy an ssrs report?
How do I find the sql server database version?
What is 1nf 2nf and 3nf?
Can we take the full database backup in log shipping?
What is cached report?
What is a result set object returned by odbc_exec()?
How to maintain a fill factor in existing indexes?
How to install sql server 2005 express edition?
What stored by the master?
can a table be moved to different filegroup? : Sql server administration
Does partitioning improve performance sql server?
What language is sql server written in?
What is the cpu pressure?
Define normalisation?