create procedure proc1
as
declare @userid int,
@username varchar(20),
select userid ,username,useraddress from user
where userid =@userid and username = @username
这样写不对吗?
...全文
337打赏收藏
存储过程的传入参数是怎么回事啊?
create procedure proc1 as declare @userid int, @username varchar(20), select userid ,username,useraddress from user where userid =@userid and username = @username 这样写不对吗?
create procedure proc1
@userid int,
@username varchar(20)
as
select userid ,username,useraddress from user
where userid =@userid and username = @username
go
create procedure proc1 @userid int,@username varchar(20)
as
select userid ,username,useraddress from user
where userid =@userid and username = @username
--run
exec proc1 具体数值,具体数值
传入参数不是这个意思
create procedure proc1
@userid int,@username varchar(20)
as
exec 'select userid ,username,useraddress from user
where userid ='+@userid+' and username = '''+@username+''''
go
create procedure proc1
as
declare @userid int,
@username varchar(20),
select userid ,username,useraddress from user
where userid =@userid and username = @username
create procedure proc1
@userid int,
@username varchar(20)
as
select userid ,username,useraddress from user
where userid =@userid and username = @username
--执行存储过程
exec proc1 1,'asdf'