By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

about number of columns in a table

P: 4
hai friends,

i created a table with a name 'emp'. And it has 4 columns. Now my question is,
tell me a query, procedure or what ever available, how to get the number of columns from a table.

thanx in advance.
Mar 22 '08 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
hai friends,

i created a table with a name 'emp'. And it has 4 columns. Now my question is,
tell me a query, procedure or what ever available, how to get the number of columns from a table.

thanx in advance.
try:

Expand|Select|Wrap|Line Numbers
  1. select count(*) from syscolumns where id in (select id from sysobjects where name = 'YourTableName')
-- CK
Mar 22 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.