You can check the availability of the view in various ways
FOR SQL SERVER
use sys.objects
IF EXISTS(
SELECT 1
FROM sys.objects
WHERE OBJECT_ID = OBJECT_ID('[schemaName].[ViewName]')
AND Type_Desc = 'VIEW'
)
BEGIN
PRINT 'View Exists'
END
use sysobjects
IF NOT EXISTS (
SELECT 1
FROM sysobjects
WHERE NAME = '[schemaName].[ViewName]'
AND xtype = 'V'
)
BEGIN
PRINT 'View Exists'
END
use sys.views
IF EXISTS (
SELECT 1
FROM sys.views
WHERE OBJECT_ID = OBJECT_ID(N'[schemaName].[ViewName]')
)
BEGIN
PRINT 'View Exists'
END
use INFORMATION_SCHEMA.VIEWS
IF EXISTS (
SELECT 1
FROM INFORMATION_SCHEMA.VIEWS
WHERE table_name = 'ViewName'
AND table_schema = 'schemaName'
)
BEGIN
PRINT 'View Exists'
END
use OBJECT_ID
IF EXISTS(
SELECT OBJECT_ID('ViewName', 'V')
)
BEGIN
PRINT 'View Exists'
END
use sys.sql_modules
IF EXISTS (
SELECT 1
FROM sys.sql_modules
WHERE OBJECT_ID = OBJECT_ID('[schemaName].[ViewName]')
)
BEGIN
PRINT 'View Exists'
END