----
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
Create Procedure vipinsert(@RETURN bit output)
AS
BEGIN
BEGIN TRANSACTION
insert into basvip(vipno,vipname,sex,tel,idcard,PROP,REGION,ADDRESS,POSTCODE,ISSUEPSN,RECPSN)
select vipno,name,case when sex=‘男‘ then 1 else 0 end ,tel,cert,‘1‘,‘1‘,‘1‘,‘1‘,‘1‘,‘1‘
from dts_vip where vipno not in (select vipno from basvip)
COMMIT TRANSACTION
SELECT @RETURN = 1
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
----
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE DBO.DTSPREPARE_vip(@T_TAB VARCHAR(20))
AS
BEGIN
IF @T_TAB = ‘DTS_vip‘
BEGIN
IF EXISTS (SELECT 1 FROM DBO.SYSOBJECTS WHERE NAME = ‘DTS_vip‘ AND XTYPE = ‘U‘)
DROP TABLE DBO.DTS_vip
CREATE TABLE [dts_vip] (
[name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[vipno] [numeric](15, 0) NULL ,
[sex] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[cert] [numeric](20, 0) NULL ,
[tel] [numeric](15, 0) NULL
) ON [PRIMARY]
END
ELSE
BEGIN
RAISERROR(‘无此临时表‘, 16, 1) WITH SETERROR
RETURN
END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
【瑞星系统】修改会员积分处理导入会员资料,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/nlg3413/p/3921502.html