Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
pascal_jimi
Posting Yak Master
167 Posts |
Posted - 2013-07-15 : 02:05:44
|
create table kateqor(id int not null identity(1,1),Name nvarchar(50))insert into kateqor(Name)values(N'M?nzild? qurum')select*from kateqorbut when I do a query declare @kat nvarchar(50)set @kat='M?nzild? qurum'select * from kateqor where Name=N(@kat)I receive an errorPost 195, Level 15, state 10, line 4'N' is not a recognized function name.kmkmmm |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-07-15 : 02:12:50
|
it should bedeclare @kat nvarchar(50)set @kat=N'M?nzild? qurum'select * from kateqor where Name=@kat ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
pascal_jimi
Posting Yak Master
167 Posts |
Posted - 2013-07-15 : 02:23:36
|
thank you visakhcreate procedure insert11 @kat nvarchar(50)asselect * from kateqor where Name=@katexec 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 @katfor example exec insert111 'M?nzild? qurum' without N'kmkmmm |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-07-15 : 02:33:31
|
quote: Originally posted by pascal_jimi thank you visakhcreate procedure insert11 @kat nvarchar(50)asselect * from kateqor where Name=@katexec 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 @katfor example exec insert111 'M?nzild? qurum' without N'kmkmmm
if you need to send value as unicode then you should use N as prefix otherwise it'll interpret it as normal varchar string.exec insert111 N'M?nzild? qurum'------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|