CREATE PROCEDURE sp_InsertUserLastInfo
@Num int,
@money varchar
AS
DECLARE
@Level int
SET NOCOUNT ON
SET @level=0
SELECT @level=ChaLevel FROM ChaInfo WHERE UserNum=@Num
IF @level<>0
BEGIN
INSERT INTO ChaLastInfo(ChaNum,ChaLevel,ChaMoney) VALUES (@Num,@level,@money)
END
SET NOCOUNT OFF
go