June 22, 2007 at 5:42 pm
Hi all,
I have the following column name that I need to know which table owns it. SC_BL_ADAPT
Is there way to find it either with SQL script or from SQL Server Enterprise Management?
Thanks in advance,
Abrahim
June 22, 2007 at 9:24 pm
As you wrote under notification services, I assume you're on sql 2005.
select
st.[name] as TableName,sc.[name] as ColumnName, ss.[name] as SchemaName from sys.columns sc
join
sys.tables st on sc.[object_id]=st.[object_id]
join
sys.schemas ss on st.[schema_id]=ss.[schema_id]
where
sc.[name]='SC_BL_ADAPT'
For sql 2000 you can use INFORMATION_SCHEMA.
June 24, 2007 at 12:27 am
Michaela,
Thanks for the help,
Abrahim
June 25, 2007 at 11:16 pm
I found this script that it finds the table's name.
SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name = 'SC_BL_ADAPT' )
Abrahim
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply