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 does normalization work?

689


Tell me what are the essential components of sql server service broker?

679


What is t-sql script to take database offline – take database online.

788


What is a system database and what is a user database?

763


What is subquery? Explain the properties of a subquery?

680






Why transaction is important?

718


What is read committed?

759


Suppose you want to implement the following relationships while designing tables. How would you do it?a.) One-to-oneb.) One-to-manyc.) Many-to-many

695


your distribution database is full what will u do

1867


Explain system rowset functions?

737


How to update a field in SQL after ALTERING a row?

877


How many joins in sql server?

687


When would you use it?

756


How can I track the changes or identify the latest insert-update-delete from a table?

714


how do you determine the Load performance of any query in sql server {example how do u determine performance of a select stmnt which returns Dynamically many no of records ... some times 100,1000,10000 etc., }

2030