I have a test table named tblTest
with two columns: name (nvarchar)
, age (tinyint)
, with values: 'My name', 10
Then, I create the following procedure:
create procedure procTest @n nvarchar as
select * from tblTest where name=@n
When I run this procedure, it return empty result:
exec procTest @n='My name'
But when I change procedure to
alter procedure procTest @n tinyint as
select * from tblTest where age=@n
and run
exec procTest @n=10
It return one row
So, what happen here? Do I miss anything?