Results 1 to 3 of 3

Thread: # of columns

  1. #1
    Ivan Guest

    # of columns


    How do you find out how many columns you have in a table instead of
    manual counting ?

    Thanks for your time.
    -Ivan

  2. #2
    al Guest

    # of columns (reply)



    try this 2 queries:

    select object_id(&#39;[table_name]&#39 <- This will return a number like this: 272004000
    then type:

    select count(*) From syscolumns where id = [number_returned]

    that&#39;s it.


    ------------
    Ivan at 4/23/01 5:07:31 PM


    How do you find out how many columns you have in a table instead of
    manual counting ?

    Thanks for your time.
    -Ivan

  3. #3
    Hiku Guest

    # of columns (reply)


    You can use
    select count(*) from syscolumns as A
    where a.id = object_id(&#39;TableName&#39
    this way you run the query once.
    Hth
    Hiku

    ------------
    al at 4/23/01 5:23:12 PM



    try this 2 queries:

    select object_id(&#39;[table_name]&#39 <- This will return a number like this: 272004000
    then type:

    select count(*) From syscolumns where id = [number_returned]

    that&#39;s it.


    ------------
    Ivan at 4/23/01 5:07:31 PM


    How do you find out how many columns you have in a table instead of
    manual counting ?

    Thanks for your time.
    -Ivan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •