标签:
CREATE PROCEDURE [dbo].[p_GetV_JJDB]
AS
BEGIN
DECLARE @sqlstr1 varchar(255)
DECLARE @sqlstr2 varchar(255)
SELECT @sqlstr1=‘IF EXISTS (SELECT 1 FROM sys.VIEWS WHERE NAME=‘‘V_JJDB‘‘) DROP VIEW V_JJDB‘--判断视图是否存在,存在则删除
SELECT @sqlstr2=‘CREATE VIEW V_JJDB AS SELECT* FROM [HNWSupDB].[dbo].[t_CJO_ReceiveAlarm]‘ --创建视图
EXEC (@sqlstr1)
EXEC (@sqlstr2)
END
标签:
原文地址:http://www.cnblogs.com/woaikongxincai/p/5310576.html