Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Location
    Midlands
    Posts
    135

    Unanswered: is there a better way to do this?

    Hi all quick quesiton. Hope you can help with this one.

    Is this the most effiecient way to do this? I want to display columns in MS SQL:

    Code:
    select
    syscolumns.name as [Column],
    syscolumns.xusertype as [Type],
    sysobjects.xtype as [Objtype]
    from
    sysobjects, syscolumns
    where sysobjects.id = syscolumns.id
    and sysobjects.xtype = 'u'
    and sysobjects.name = 'tblAssociation'
    order by syscolumns.name
    Hope you can help.

    Kind regards
    MG

  2. #2
    Join Date
    Dec 2008
    Posts
    135
    select * from information_schema.columns where table_name = 'tblAssociation'

  3. #3
    Join Date
    Jun 2009
    Location
    Midlands
    Posts
    135
    Hi all, have used one of these:


    select * from information_schema.columns where table_name = 'x'

    select * from information_schema.columns where table_name = 'tblAssociation'


    Thought id let you know.

    Regards
    MG

Posting Permissions

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