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 / harshad

select count(*) from information.schema.columns
where table_name='tablename'

//where tablename is name of your sql table.
//do not prefix table name with .dbo

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to replicate data from sql server to oracle? : sql server replication

1034


Is truncate a dml command?

889


How do I view a stored procedure in sql server query?

886


Where sql server usernames and passwords are stored in a sql server?

933


What is trigger explain with program?

931


How can a user-defined datatype be created?

935


How to list all user defined functions in the current database?

975


What are the properties of primary key?

913


State a few properties of relational databases?

1060


What are 3 ways to get a count of the number of records in a table?

1017


Explain what is the difference between a local and a global temporary table?

936


How to create user messages with print statements in ms sql server?

940


What are commit and rollback in sql?

1052


Which language is supported by sql server?

954


How to throw custom exception in Stored Procedure?

992