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
What do you understand by the analysis services in sql server?
Which are the two editions in which SQL Azure database available?
What is transaction server distributed transaction?
What are blobs, tables, and Queues? Is SQL is the standard way to query blobs, tables, and queues?
What is the function of inner join?
What is a document index?
How to convert numeric expression data types using the cast() function?
How to defragment table indexes?
Explain filestream storage of sql server 2008?
Is it possible to have clustered index on separate drive from original table location?
Explain the usage of floor function in sql server.
What protocol does sql server use?
What stored by the master?
What is user-defined function?
What is parameterized reports in ssrs ?