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

Explain the properties of a relational table?

748


What is dbcc command in sql server?

773


What is instead of dml trigger?

770


Describe in brief sql server monitoring ways.

752


What happens to a trigger with multiple affected rows?

691






What according to you is the difference between mysql and sql server performance?

764


What is normalization? What number of normalization shapes are there?

794


How many triggers are possible per table?

806


What is difference between index seek vs. Index scan?

816


Explain use of expression builder.

737


What is difference between stored procedure and user defined function?

724


What is nested transaction?

758


Can we delete data from a view?

704


can a database be shrunk with users active? : Sql server administration

755


what's the maximum size of a row? : Sql server database administration

736