Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003

    Question Unanswered: Table name from syscolumns

    what key in syscolumns gives the parent table name from sysobjects?

  2. #2
    Join Date
    Nov 2004
    on the wrong server
    Provided Answers: 6
    I believe it is id and the unique on the row is colid. please refer to books online to confirm.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Dec 2011
    This should do the trick

    SELECT TOP 1000 [tables].[object_id]
    ,Name = [columns].[name]
    ,TableName = [tables].name
    FROM [MedManage].[sys].[columns]
    LEFT JOIN [MedManage].[sys].[tables] ON [tables].[object_id] = [columns].[object_id]
    WHERE [tables].name IS NOT NULL

  4. #4
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    Thrasymachus is correct. JCoetzee offered a solution that will sometimes work on newer database engines.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

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