Monday, March 12, 2012

Query to get name of views which reference a give column from

I have 3 to 4 tables with the same column names, so it displays views for al
l
the tables ,
any additions '
Thanks a Lot
"Alejandro Mesa" wrote:
> Rodger,
> check view INFORMATION_SCHEMA.COLUMNS
> Example:
> use northwind
> go
> declare @.cn sysname
> set @.cn = N'OrderID'
> select TABLE_NAME
> from INFORMATION_SCHEMA.COLUMNS
> where COLUMN_NAME = @.cn and
> objectproperty(object_id('[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']'),
> 'IsView') = 1
> go
>
> AMB
> "Rodger" wrote:
>use information_Schema.view_column_usage
"Rodger" wrote:
> I have 3 to 4 tables with the same column names, so it displays views for
all
> the tables ,
> any additions '
> Thanks a Lot
> "Alejandro Mesa" wrote:
>|||It worked...great... never tried these wonderful views.
Thanks
rodger
"Omnibuzz" wrote:
> use information_Schema.view_column_usage
> "Rodger" wrote:
>|||Check out all the view in INFORMATION_SCHEMA. if you are interested. gives a
lot of metadata. And if you have no further questions can you close this
thred.
Thanks
Omnibuzz
"Rodger" wrote:
> It worked...great... never tried these wonderful views.
> Thanks
> rodger
> "Omnibuzz" wrote:
>

No comments:

Post a Comment