July 15, 2013 at 12:02 am
create table kateqor
(id int not null identity(1,1),
Name nvarchar(50))
insert into kateqor
(Name)
values
(N'Mənzildə qurum')
select*from kateqor
but when I do a query
declare @kat nvarchar(50)
set @kat='Mənzildə qurum'
select * from kateqor where Name=N(@kat)
I receive an error
Post 195, Level 15, state 10, line 4
'N' is not a recognized function name.
July 15, 2013 at 12:30 am
declare @kat nvarchar(50)
set @kat='M?nzild? qurum'
select * from kateqor where Name=(@kat)
use this query
July 15, 2013 at 12:33 am
create procedure insert11
@kat nvarchar(50)
as
select * from kateqor where Name=@kat
exec insert11 N'M?nzild? qurum'
but the problem is that I need to send only @kat
without N '
how mak i create proc
execute only @kat
for example
exec insert111 'M?nzild? qurum'
without N'
July 15, 2013 at 1:04 am
You need to apply the "N" when you set the value of the variable and not when you use the variable to fileter your results. This will work:
declare @kat nvarchar(50)
set @kat=N'M?nzild? qurum'
select * from kateqor where Name=@kat
July 15, 2013 at 1:10 am
If you want to pass an unicode value to a stored procedure, you first need to set the value to a variable. Then pass the variable to the stored procedure:
declare @kat nvarchar(50)
set @kat=N'M?nzild? qurum'
exec insert11 @kat
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply