IF exists(select 1 from [dbo].[vw_Me]) BEGIN drop view [dbo].[vw_ME] END ELSE BEGIN declare @sql varchar(1000) select @sql = 'CREATE VIEW VW_ME AS SELECT * FROM drug' exec (@sql) END
IF OBJECT_ID('vw_Me', 'V') IS NOT NULL DROP VIEW vw_Me; GO ... -- now create it
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)