How to check if View is present in Database?

 Posted by vishalneeraj-24503 on 7/1/2014 | Category: Sql Server Interview questions | Views: 479 | Points: 40

We can use the below Query to check whether particular view is present or not:-
if exists(select * 

from sys.views
where object_id = object_id(n'[dbo].[vw_name]'))
print 'view exists'
print 'view does not exists'

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response