Hello.
I have a problem with update Unicode field in MS SQL Server 2000.
When I insert new row into the table and fill some Unicode field with some
data it's working fine, but when I try to update existing record with some
new values in Unicode fields the data is displaying as "?" symbols.
Can anybody tell me how can I solve this problem?A table definition and the update statement would be helpful.
A quick example that may be helpful to you:
CREATE TABLE Frog (
UnicodeColumn nvarchar(50),
ANSIColumn varchar(50)
)
GO
INSERT FROG VALUES (N'Some Unicode Data goes here', 'ANSI data here')
GO
SELECT * FROM Frog
GO
UPDATE Frog
SET UnicodeColumn = N'Other Unicode Data'
GO
SELECT * FROM Frog
GO
-- Notice the N in front of the Unicode data segment. This tells SQL Server
that "National" character data follows.
HTH
Rick Sawtell
"David" <david_dvali@.hotmail.com> wrote in message
news:OwBu3y1bEHA.1132@.TK2MSFTNGP10.phx.gbl...
> Hello.
> I have a problem with update Unicode field in MS SQL Server 2000.
> When I insert new row into the table and fill some Unicode field with some
> data it's working fine, but when I try to update existing record with some
> new values in Unicode fields the data is displaying as "?" symbols.
> Can anybody tell me how can I solve this problem?
>|||How can I use 'N' in parametrized SQL?
"Rick Sawtell" <r_sawtell@.hotmail.com> wrote in message
news:e9gN9P3bEHA.4092@.TK2MSFTNGP11.phx.gbl...
> A table definition and the update statement would be helpful.
> A quick example that may be helpful to you:
> CREATE TABLE Frog (
> UnicodeColumn nvarchar(50),
> ANSIColumn varchar(50)
> )
> GO
>
> INSERT FROG VALUES (N'Some Unicode Data goes here', 'ANSI data here')
> GO
> SELECT * FROM Frog
> GO
> UPDATE Frog
> SET UnicodeColumn = N'Other Unicode Data'
> GO
> SELECT * FROM Frog
> GO
>
> -- Notice the N in front of the Unicode data segment. This tells SQL
Server
> that "National" character data follows.
>
> HTH
> Rick Sawtell
>
> "David" <david_dvali@.hotmail.com> wrote in message
> news:OwBu3y1bEHA.1132@.TK2MSFTNGP10.phx.gbl...
> > Hello.
> >
> > I have a problem with update Unicode field in MS SQL Server 2000.
> >
> > When I insert new row into the table and fill some Unicode field with
some
> > data it's working fine, but when I try to update existing record with
some
> > new values in Unicode fields the data is displaying as "?" symbols.
> >
> > Can anybody tell me how can I solve this problem?
> >
> >
>|||You don't need to use the N if you are passing your data in RPC parameters.
What API are you using? When you define the parameter are you setting it
up as a Unicode param? A bit of sample code showing how you pass your data
in might help.
Bart
--
Bart Duncan
Microsoft SQL Server Support
Please reply to the newsgroup only - thanks.
This posting is provided "AS IS" with no warranties, and confers no rights.
| Reply-To: "David" <david_dvali@.hotmail.com>
| From: "David" <david_dvali@.hotmail.com>
| References: <OwBu3y1bEHA.1132@.TK2MSFTNGP10.phx.gbl>
<e9gN9P3bEHA.4092@.TK2MSFTNGP11.phx.gbl>
| Subject: Re: Problem With Update Unicode Field
| Date: Thu, 22 Jul 2004 13:41:26 +0400
| Lines: 59
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <eX60aB9bEHA.4032@.TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.server
| NNTP-Posting-Host: ge-tbs-ats77-tc-ppp12.wanex.net 213.131.38.173
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:352505
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| How can I use 'N' in parametrized SQL?
|
| "Rick Sawtell" <r_sawtell@.hotmail.com> wrote in message
| news:e9gN9P3bEHA.4092@.TK2MSFTNGP11.phx.gbl...
| > A table definition and the update statement would be helpful.
| >
| > A quick example that may be helpful to you:
| >
| > CREATE TABLE Frog (
| > UnicodeColumn nvarchar(50),
| > ANSIColumn varchar(50)
| > )
| > GO
| >
| >
| > INSERT FROG VALUES (N'Some Unicode Data goes here', 'ANSI data here')
| > GO
| >
| > SELECT * FROM Frog
| > GO
| >
| > UPDATE Frog
| > SET UnicodeColumn = N'Other Unicode Data'
| > GO
| >
| > SELECT * FROM Frog
| > GO
| >
| >
| > -- Notice the N in front of the Unicode data segment. This tells SQL
| Server
| > that "National" character data follows.
| >
| >
| > HTH
| >
| > Rick Sawtell
| >
| >
| >
| > "David" <david_dvali@.hotmail.com> wrote in message
| > news:OwBu3y1bEHA.1132@.TK2MSFTNGP10.phx.gbl...
| > > Hello.
| > >
| > > I have a problem with update Unicode field in MS SQL Server 2000.
| > >
| > > When I insert new row into the table and fill some Unicode field with
| some
| > > data it's working fine, but when I try to update existing record with
| some
| > > new values in Unicode fields the data is displaying as "?" symbols.
| > >
| > > Can anybody tell me how can I solve this problem?
| > >
| > >
| >
| >
|
|
|
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment