How to check if View is present in Database?

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

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'
else
print 'view does not exists'


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response