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 the limitations/drawbacks or ssrs 2008 r2?

99


What is the purpose of grouping data in a report?

624


How to delete duplicate rows in sql server?

662


explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration

713


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1382






Which are new data types introduced in sql server 2008?

710


Can we shrink data file in sql server?

628


What is difference between equi join and natural join?

629


what are the three command line utilities and what are their primary functions?

113


Explain index in sql server?

670


What is difference between rownum and row_number?

604


How can we use ConnectorJ JDBC Driver with MS SQL?

647


What is the syntax to execute the sys.dm_db_missing_index_details? : sql server database administration

711


What is a primary index?

620


what is the difference between openrowset and openquery?

669