Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

storing foreign language
I would like to store a mix of english and hebrew in a column.  I declared a
column as nvarchar, which is supposed to be able to store unicode, however
all hebrew letters are stored as question marks. I then tried to set the
collate of the column to hebrew_bin, but that did not help. I then changed
the database collate to hebrew_bin, and that worked, but the database became
case-sensitive. I don't understand why nvarchar can't store hebrew without
changing the collate, I thought collate was just for sorting and comparisons
.
Also why didn't the column-level collate help?

create database test
go
use test
go
create table t (s nvarchar(100) collate hebrew_bin)
insert t (s) values('םולש')

select * from t

go

create database test2 collate hebrew_bin
go
use test2
go
create table t2 (s nvarchar(100) )
insert t2 (s) values('םולש')

select * from t2



--
mg

Report this thread to moderator Post Follow-up to this message
Old Post
mikegellis
07-28-05 01:23 AM


RE: storing foreign language
I realized that inserting the data prefixed with N works (see example below)
-
that tells sql server that it is unicode data (you don't need the collate
anymore). Is this the best way to do it? All inserts have to be prefixed wit
h
N? Or is there a global setting that forces it to use unicode?

create database test
go
use test
go
create table t (s nvarchar(100))
insert t (s) values(N'םולש')

select * from t

--
mg


"mikegellis" wrote:

> I would like to store a mix of english and hebrew in a column.  I declared
 a
> column as nvarchar, which is supposed to be able to store unicode, however
> all hebrew letters are stored as question marks. I then tried to set the
> collate of the column to hebrew_bin, but that did not help. I then changed
> the database collate to hebrew_bin, and that worked, but the database beca
me
> case-sensitive. I don't understand why nvarchar can't store hebrew without
> changing the collate, I thought collate was just for sorting and compariso
ns.
> Also why didn't the column-level collate help?
>
> create database test
> go
> use test
> go
> create table t (s nvarchar(100) collate hebrew_bin)
> insert t (s) values('םולש')
>
> select * from t
>
> go
>
> create database test2 collate hebrew_bin
> go
> use test2
> go
> create table t2 (s nvarchar(100) )
> insert t2 (s) values('םולש')
>
> select * from t2
>
>
>
> --
> mg

Report this thread to moderator Post Follow-up to this message
Old Post
mikegellis
07-28-05 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 12:17 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006