34,837
社区成员




create PROCEDURE instText(
@Amsg varchar(500),
@Atel varchar(200),
@Acode varchar(30),
@Asource smallint,
@ID bigint OUTPUT /* 如果存在返回ID=1,否则插入 */
)
as
if exists(select id from msg where msg=@Amsg and tel=@Atel and code=@Acode and source=@Asource)
set @ID=1
else
INSERT INTO msg (msg,tel,code,source) VALUES (@Amsg,@Atel,@Acode,@Asource)
go