复制Create proc sp_Insert_Student @No char(10),存储插入 @Name varchar(20), @Sex char(2), @Age int, @rtn int output as declare @tmpName varchar(20), @tmpSex char(2), @tmpAge int if exists(select * from Student where No=@No) begin select @tmpName=Name,@tmpSex=Sex,@tmpAge=Age from Student where No=@No if ((@tmpName=@Name) and (@tmpSex=@Sex) and (@tmpAge=@Age)) begin set @rtn=0 --有相同的数据,直接返回值 end else begin update Student set Name=@Name,过程更新Sex=@Sex,Age=@Age where No=@No set @rtn=2 --有主键相同的b2b供应网数据,进行更新处理 end end else begin insert into Student values(@No,实现数据@Name,@Sex,@Age) set @rtn=1 --没有相同的亿华云数据,存储插入进行插入处理 end 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.b2b信息网