请教存储过程的错误
创建了一个用户信息表userinfo,下面是新建的存储过程,运行出错(要我声名变量)REATE PROCEDURE dbo.CreateUser
(
@username varchar(50),
@password varchar(50),
@realname varchar(50),
@gender char(1),
@phoneno varchar(20),
@email varchar(50),
@address varchar(50),
)
AS
if exists
(
select id from userinfo where username=@username
)
return 1--用户已经存在
insert into userinfo ( username,password, realname,gender,phoneno, email, address)
values ( @username,@password,@realname,@gender,@,phoneno,@email,@address)
return 0--用户信息添加成功
GO