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 2000 Forums
 Transact-SQL (2000)
 "unicode data stored procedure"

Author  Topic 

nawazbutt
Starting Member

1 Post

Posted - 2002-03-22 : 03:15:06
I am inserting unicode data(arabic data) in SQL server using insert statement as follows:

INSERT INTO tablename (col1,col2) values (Nvalue1,value2)

WHERE col1 is of NVARCHAR datatype.
col2 is of VARCHAR datatype.
N clause is to insert unicode data.

i want to run the above statement using stored procedure.If i m using 'N' clause in INSERT statement in a stored procedure it is giving error.The 'N' clause is necessary bcz with out it unicode data will convert to '????????????' i.e garbage.



Swede
Yak Posting Veteran

74 Posts

Posted - 2002-03-22 : 03:40:06
This doesn't work?

CREATE PROCEDURE yourprocedure
@theinsert1 nvarchar(50),
@theinsert2 varchar(50)
AS
INSERT INTO yourtable (yourvalue1, yourvalue2)
VALUES(@theinsert1, @theinsert2)
GO

=====================================
Why not try and do the impossible?
Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-03-23 : 03:29:11

INSERT INTO tablename (col1,col2) values (N'value1',value2)

or

INSERT INTO tablename (col1,col2) values (cast(value1 as nvarchar),value2)

HTH


--------------------------------------------------------------
Go to Top of Page

alzogbi
Starting Member

9 Posts

Posted - 2002-08-24 : 03:49:20
Hi,
Well I am facing the same problem too. My Insert statement in the SP is inserting some ???? in the table.

I wish if someone can show me the way of inserting REAL Unicode charchters.

Thanx,

Mazen

Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-08-26 : 21:23:48
alzogbi, re-read Nazim's post above yours. It should work just fine. If not, post back with some more details like your table definition in the form of a CREATE TABLE statement, and the SQL you are using to inser the data.

Go to Top of Page
   

- Advertisement -