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