Monday, March 19, 2012

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,
KeithUSE Northwind
GO

DECLARE @.TABLE_NAME sysname

SELECT @.TABLE_NAME = 'Orders'

SELECT TABLE_SCHEMA
FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME = @.TABLE_NAME|||I'd use:SELECT TABLE_SCHEMA AS owner
FROM INFORMATION_SCHEMA.TABLES
WHERE 'myTable' = TABLE_NAME
-PatP

No comments:

Post a Comment