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

Answer Posted / sujitha

SELECT DISTINCT SYS.NAME,COUNT(*) FROM SYSOBJECTS SYS
INNER JOIN SYSCOLUMNS SYSCOL ON SYSCOL.ID=SYS.ID
WHERE SYS.XTYPE='U' GROUP BY SYS.NAME

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to list all tables in the database using odbc_tables()?

568


What is 1nf 2nf and 3nf?

493


Explain magic tables in sql server?

551


How to write a query with a left outer join in ms sql server?

575


Can You Use A Stored Procedure To Provide Data To An Ssrs Report?

109






Call by value and call by reference in procedure and function, with NOCOPY.

841


What is the sql server 2000 version number?

550


What is truncate table?

550


How do you send email on SQL Server?

584


how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?

1101


How many types of stored procedures are there in sql server?

562


Explain what is the function of sql server agent windows service?

544


What is a database table?

523


What are the requirements on sql server network connections?

523


How to defragment table indexes?

550