Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / anand k

--Count of Columns
SELECT COUNT(*) NO_OF_COLUMNS
FROM SYS.COLUMNS
WHERE OBJECT_ID = OBJECT_ID('<TableName>')
ORDER BY Column_ID

--Column Names
SELECT [NAME]
FROM SYS.COLUMNS
WHERE OBJECT_ID = OBJECT_ID('<TableName>')
ORDER BY Column_ID

Is This Answer Correct ?    14 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is server-level principal?

120


What is difference between rownum and row_number?

917


Explain the use of containers in ssis?

897


What is a result set object returned by mssql_query()?

1086


What are the properties of primary key?

920


How to delete duplicate rows in sql server?

1063


How to create a new schema in a database?

1078


What is the index requirement in SQL Azure?

96


What are the dmvs? : sql server database administration

1011


What are the differences between ms sql server & oracle?

1012


Explain the microsoft sql server delete command? : SQL Server Architecture

1021


Tell me what is fill factor?

914


When would you use it?

951


explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?

2438


what is the difference between delete table and truncate table commands? : Sql server database administration

976