Jeyakumar_mcp
asked on
Passing N prefix to stored procedure variable
In a table I have a column to hold kpi names in czech language. Column type is nvarchar.
Below sp will query the table to get kpi id.
ALTER PROC [dbo].[USP_GetKPiValue]
@SKPI_DisplayText nvarchar(25)
AS
BEGIN
SELECT KPI_ID from dbo.tblKPI where KPI_DisplayText = @SKPI_DisplayText or KPI_Name_Czech = @SKPI_DisplayText
END
But this query is not responding as expected. if I run the query with direct value like below, it works.
SELECT KPI_ID FROM dbo.tblKPI where KPI_Name_Czech = N'Nevyu~itý as'
Can anybody give me a solution to add 'N' to the stored procedure variable?
Below sp will query the table to get kpi id.
ALTER PROC [dbo].[USP_GetKPiValue]
@SKPI_DisplayText nvarchar(25)
AS
BEGIN
SELECT KPI_ID from dbo.tblKPI where KPI_DisplayText = @SKPI_DisplayText or KPI_Name_Czech = @SKPI_DisplayText
END
But this query is not responding as expected. if I run the query with direct value like below, it works.
SELECT KPI_ID FROM dbo.tblKPI where KPI_Name_Czech = N'Nevyu~itý as'
Can anybody give me a solution to add 'N' to the stored procedure variable?
ASKER
Nope, am calling the sp from Asp.net application. My question is to add N prefix inside the stored procedure. I tried adding single quote's by string concat.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
bcvbvb
so, you need to call it like this:
Open in new window