Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Posts
    7

    Unanswered: How do I get Table Owner?

    I need to the table owner.
    Not from in Enterprise Manager, but from my app. (it's written in Delphi).

    Any suggestions?

    Thank you,
    Keith

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Code:
    USE Northwind
    GO
    
    DECLARE @TABLE_NAME sysname
    
    SELECT @TABLE_NAME = 'Orders'
    
    SELECT TABLE_SCHEMA 
      FROM INFORMATION_SCHEMA.Tables
     WHERE TABLE_NAME = @TABLE_NAME
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd use:
    Code:
    SELECT TABLE_SCHEMA AS owner
       FROM INFORMATION_SCHEMA.TABLES
       WHERE 'myTable' = TABLE_NAME
    -PatP
    Last edited by Pat Phelan; 03-09-05 at 17:45. Reason: Sniped!

Posting Permissions

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