Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arabic langauge not display when i make search by arabic langauge why

Status
Not open for further replies.

ahm1985

Programmer
Dec 6, 2012
138
EG
Hi guys

I have database hr has table Employee this table has field EmployeeName

EmployeeName nvarchar(50)

when i write in query analyzer :

select ^ from Employee where EmployeeName='احمد'

not give me any result

but when i write

select * from Employee where EmployeeName=N'احمد'

it give me result

meaning it support arabic

but i have stored procedure not accept arabic and i dont know how to handel it to accept search by EmployeeName

CREATE Procedure sp_EmployeeSelect
@EmployeeName nvarchar(50)
AS
Declare @SQLQuery as nvarchar(2000)
SET @SQLQuery ='SELECT * from Employee Where (1=1)'
If @EmployeeName <>''
Set @SQLQuery = @SQLQuery + ' AND (EmployeeName LIKE ''%'+@EmployeeName +'%'') '
Exec (@SQLQuery)

what is the proplem in this stored procedure and how to solve it

please help me
 

this one should work
SQL:
CREATE Procedure sp_EmployeeSelect
@EmployeeName nvarchar(50)
AS
Declare @SQLQuery as nvarchar(2000)
SET @SQLQuery ='SELECT * from Employee Where (1=1)'
If @EmployeeName <>''
Set @SQLQuery = @SQLQuery + ' AND (EmployeeName LIKE N''%'+@EmployeeName +'%'') '
Exec (@SQLQuery)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top