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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Insert Arabic Text through Store Procedure

Author  Topic 

mohan.g
Starting Member

1 Post

Posted - 2009-03-09 : 02:00:30
Hi,

I have a simple Insert Stored Procedure which will take arabic text as input parameters.All my Input parameters are NVARCHAR.
Also I am aware of Using N Prefix of arabic text, this works only if you call execute the stored procedure withh dummy data in the query analyzer it works fine...but if you call this stored procedure from .Net code, the arabic text is not inserting...

Below is the Stored Procedure.
CREATE PROCEDURE [Insert_ClubDetails]
(
@ClubCode NVARCHAR(20),
@ClubName NVARCHAR(50),
@ClubImagePath NVARCHAR(100),
@City NVARCHAR(20),
@Status BIT,
@Description NVARCHAR(50)

)
AS
BEGIN

PRINT 'ClubCode'
Print @ClubCode
SET NOCOUNT ON

DECLARE @SQL VARCHAR(MAX)

SET @SQL = 'INSERT INTO tbClubDetails
(
ClubCode,
ClubName,
Clublogopath,
City,
Status,
Description,
CreatedDateTime
)
VALUES
(N'+ @ClubCode,'N' + @ClubName + ',N' + @ClubImagePath + ',N' + @City + ',1,N' + @Description + ',GETDATE())'

PRINT @SQL
EXEC(@SQL)

END

It would be great if anyone can help me out of inserting arabic text through stroed procedure,

Many Thanks,
Mohan

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-09 : 03:42:08
Making your your .NET app can see it properly; I don't see anything in this code to stop it..

Try changing ... DECLARE @SQL VARCHAR(MAX) ? Try changing it to DECLARE @SQL nvarchar(MAX).

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page
   

- Advertisement -