TRY BELOW:CREATE PROCEDURE pr_In_Post1
@temp_TopicID int,
@temp_BoardsID int,
@temp_strUID int,
@temp_strNickName varchar(50),
@temp_Title varchar(100),
@temp_Content ntext,
@temp_TopicSize varchar(10),
@temp_IP varchar(15),
@temp_Expression int,
@temp_HaveSign int AS
SET NOCOUNT ONdeclare @rc int
select @rc =0
if @rc=0
begin 
insert into Post(TopicID,BoardsID,UID,UserNickName,PostTitle,PostContent,TopicSize,IP,Expression,HaveSign) 
values (@temp_TopicID,@temp_BoardsID,@temp_strUID,@temp_strNickName,@temp_Title,@temp_Content,@temp_TopicSize,@temp_IP,@temp_Expression,@temp_HaveSign)
select @rc=@@error
 IF @rc<>0 
begin
SELECT @RC=-1
RETURN @RC
END update t_Topic set ReplyNum=ReplyNum+1 where TopicID=@temp_TopicID
SELECT @RC=@@ERROR
 IF @rc<>0 
begin
SELECT @RC=-2
RETURN @RC
END select max(PostID) as PostID from Post RETURN @RC
ENDGO