how to find number of columns in a table in sql server 2000
and 2005 also

Answer Posted / kishore

select count(*) NoOfColumns from SYSCOLUMNS
WHERE id= (Select id from SYSOBJECTS where name = 'city')

In this querry may name is Tablename

Is This Answer Correct ?    58 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are trace files?

521


Is foreign key a primary key?

502


What is data modeling and Reterminal integrity?

1478


Why do you need a sql server?

496


Do you know what are the ways available in sql server to execute sql statements?

536






Does an index slow down updates on indexed columns?

569


How to change the data type of an existing column with "alter table" statements in ms sql server?

525


How would we use distinct statement? What is its use?

596


what is the difference between Tabular and Matrix report?

122


What is always encrypted?

512


what is a check constraint?

626


Where can you find the error log information? : sql server database administration

557


How to execute stored procedure and set temp table in sql server?

548


What is the contrast between sql and pl/sql?

615


How to select some specific rows from a table in ms sql server?

558