Interesting question~

  • Thread starter ºa¤Ö@¤½¥q
  • Start date
º

ºa¤Ö@¤½¥q

I find a interesting question, and I cannot solve it
@.@

If i want to insert unicode data, I need using recordset.addnew instead of
using "insert into table" query or "stored procedure"

All unicode data inserted into database through insert query or stored
procedure would become a question mark "?" no matter:
1. the field is nvarchar
2. the collpase is SQL_Latin_General_CP1_XX_XX" or
"SQL_Latin_General_CP850_XX_XX"
3. the @codepage=65001
4. the charset of html page set to utf-8
5. or both above solution

That means i cannot hide my database structure by using stored procedure, i
need place ALL code inside asp and the asp become very heavy....

Any solution?

Thanks
 
A

Aaron Bertrand [SQL Server MVP]

This is not true. Did you prefix the string with the N character?

CREATE PROCEDURE dbo.foo
@param NVARCHAR(255)
AS
BEGIN
SET NOCOUNT ON
INSERT table(column) SELECT @param
END
GO

Then from ASP:

conn.execute "EXEC dbo.foo @param = N'bar'",,129

This works for me just fine.
 
º

ºa¤Ö@¤½¥q

yes~
I missed to mention it
I tried this way already

but still become question mark "?"
^.^
 
º

ºa¤Ö@¤½¥q

This one I tried with error occurred
Example:
table: customer
field: name_tc nvarchar(10)

and I used command object to create parameter object and append to
adodb.command
and the type should be
set param = createParameter("@NameTc", adVarWChar, adInputParam, 10,
variable_of_name)

but dont know why the server prompt something like the length of data I
provided is longer than the field's length....

Let me try again
^.^
 
A

Aaron Bertrand [SQL Server MVP]

but still become question mark "?"

How have you verified that this is what is STORED? It sounds like this is
what you see when you display it on your web page, but I am not convinced
that what is in the database is ?
 
º

ºa¤Ö@¤½¥q

Yes
I using MSSQL 2000 Enterprise Manager and query the database data
and it stored question mark as well
^.^
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top