我有一张桌子
create table user (userId varchar(8) not null, userName varchar(8) not null)
insert into user
select 'NAME1','name1'
union all
select 'NAME2', 'name2'
union all
select 'NAME3','name3'
我已将存储过程用于通配符参数:
create procedure wildcard_name
@userName nchar(8)= '%'
as
select * from user
where userName like @userName;
exec wildcard_name 'n%';
exec 语句没有给出任何结果,为什么?