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
时间: 2024-10-10 17:22:17