Create PROCEDURE dbo.NewConference
(
@UserId int,
@Name varchar(100),
@Abbreviation varchar(100),
@HomePage varchar(100),
@Summary text,
@AddedDate datetime,
@Date datetime
)
AS
SET NOCOUNT off
Begin tran 开始事务
INSERT INTO xx (...)VALUES(...)
declare @ConId int
select @ConId=Id from xx where xx
INSERT INTO xx (...)VALUES(...)
declare @ColuId int
select @ColuId=Id from xx where xx
INSERT INTO xxx(...) VALUES(...)
INSERT INTO xxx*(...) VALUES (...)
commit tran 提交事务
RETURN @@rowcount 返回受影响行数
(
@UserId int,
@Name varchar(100),
@Abbreviation varchar(100),
@HomePage varchar(100),
@Summary text,
@AddedDate datetime,
@Date datetime
)
AS
SET NOCOUNT off
Begin tran 开始事务
INSERT INTO xx (...)VALUES(...)
declare @ConId int
select @ConId=Id from xx where xx
INSERT INTO xx (...)VALUES(...)
declare @ColuId int
select @ColuId=Id from xx where xx
INSERT INTO xxx(...) VALUES(...)
INSERT INTO xxx*(...) VALUES (...)
commit tran 提交事务
RETURN @@rowcount 返回受影响行数