Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Check if a view exists

Author  Topic 

Gavin1977
Starting Member

16 Posts

Posted - 2008-06-05 : 04:46:35
Hello all.

Can anyone tell me how to go about establishing if a particular view exists on a table?

Thanks.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-05 : 05:29:30
SELECT * FROM INFORMATION_SCHEMA.VIEW_TABLE_USAGE where VIEW_NAME='YourViewName' AND TABLE_NAME='YourTableName'
returns record if the view exists on table
Go to Top of Page

Gavin1977
Starting Member

16 Posts

Posted - 2008-06-05 : 05:59:38
excellant. Thanks for your help visakh16 :)
Go to Top of Page
   

- Advertisement -