Showing posts with label sql_latin1_general_cp1_ci_as. Show all posts
Showing posts with label sql_latin1_general_cp1_ci_as. Show all posts

Sunday, February 12, 2012

collations and nvarchar

Should a programmer bother using nvarchar for a person's name (special chracters allowed) if I still use SQL_Latin1_General_CP1_CI_AS?

I don't think you can get ascent with Varchar because those characters are not ASCII that is the reason Greek and other similar languages comes with separate code pages and collations.

http://msdn2.microsoft.com/en-us/library/ms144250.aspx

Collations ... blah!

What collation setting(s) do I need to set with RebuildM to get the
SQL_Latin1_General_CP1_CI_AS collation?
3rd time going and I can't seem to set/select the right configuration.
Thanks,
MorganFound it...
Dictionary Order, case insensitive for use with 1252 Char Set.
Thanks,
Morgan
"Morgan" <mfears@.spamcop.net> wrote in message
news:ueb0z8jxDHA.2328@.TK2MSFTNGP10.phx.gbl...
> What collation setting(s) do I need to set with RebuildM to get the
> SQL_Latin1_General_CP1_CI_AS collation?
> 3rd time going and I can't seem to set/select the right configuration.
>
> Thanks,
> Morgan
>

Collation?

Can you explain me what a collation is?
"Cannot resolve the collation conflict between SQL_Latin1_General_CP1_CI_AS
and Latin1_General_CI_AS in the equal to operation.: 468"
Thanks!Per BOL, "Collations specify the rules for how strings of character data are
sorted and compared, based on the norms of particular languages and locales."
I'd suggest looking up collations on the index tab in SQL Server Books
Online. It has a detailed description.
Linchi
"Paulo" wrote:
> Can you explain me what a collation is?
> "Cannot resolve the collation conflict between SQL_Latin1_General_CP1_CI_AS
> and Latin1_General_CI_AS in the equal to operation.: 468"
> Thanks!
>
>

Friday, February 10, 2012

Collation Questions SQL Server 2005 SP2

A few collation questions on SQL Server 2005 SP2, which I'll call SQLS.

The default collation for SQLS is apparently SQL_Latin1_General_CP1_CI_AS.

I wish to use a variation of this, SQL_Latin1_General_CP1_CS_AI
collation, but there is no such collation returned from
fn_helpcollations(). Also, if I try to use this collation in
a CREATE DATABASE stmt, SQLS yells about it.

I see that there is a Latin1_General_CS_AI. What effects are there
in using this collation? The SQL_* collations are SQL collations,
while non-SQL_* collations are Windows collations, yes? SQLS runs
only on Windows, so am I safe in using Latin1_General_CS_AI? What
does the CP1 in the SQL collation signify? Am I asking for trouble?
-----------
Assuming that I set Latin1_General_CS_AI (or any other case-sensitive
collation) at the database level, I believe my DDL/DML for that database
also becomes case-sensitive. How can I specify that I want ONLY my data
access to be case-sensitive, and not my DDL/DML? I don't want to have
to remember to type "select * from MyCamelCase" when "mycamelcase"
should work.

Any help appreciated.

A new SQLS DBA..

ajaj (ronald@.mcdonalds.com) writes:

Quote:

Originally Posted by

A few collation questions on SQL Server 2005 SP2, which I'll call SQLS.
>
The default collation for SQLS is apparently SQL_Latin1_General_CP1_CI_AS.


The default collation when you install SQL Server depends on your regional
settings. SQL_Latin1_General_CP1_CI_AS is what you get when your regional
settings is English (US).

Quote:

Originally Posted by

I see that there is a Latin1_General_CS_AI. What effects are there
in using this collation? The SQL_* collations are SQL collations,
while non-SQL_* collations are Windows collations, yes? SQLS runs
only on Windows, so am I safe in using Latin1_General_CS_AI? What
does the CP1 in the SQL collation signify? Am I asking for trouble?


You should be fine. About everywhere else in the world when you install SQL
Server, the default collation is a Windows collation. For instance, in my
case it's Finnish_Swedish_CI_AS (but I always change it to
Finnish_Swedish_CS_AS.)

Windows collations are drawn from Windows and Unicode, and the sorting for
varchar and nvarchar data is the same (save that nvarchar includes far more
characters). SQL collations on the other hand are completely different
for varchar and nvarchar. For varchar they are just an 8-bit character
set, while for nvarchar they are Unicode. The flip side of this is since
they for varchar only have 255 charcters, operations with varchar are
quite a bit faster with SQL collations than with Windows collations (save
binary collations). However, there are also potential for performance
disasters with SQL collations if you join varchar and nvarchar that
are less likly to occur with Windows collations.

Quote:

Originally Posted by

Assuming that I set Latin1_General_CS_AI (or any other case-sensitive
collation) at the database level, I believe my DDL/DML for that database
also becomes case-sensitive. How can I specify that I want ONLY my data
access to be case-sensitive, and not my DDL/DML? I don't want to have
to remember to type "select * from MyCamelCase" when "mycamelcase"
should work.


You would have to set the database collation to be one that fits your
preference for identifiers and then explcitly set the collation for each
column to be case-sensitive.

My strong recommendation is that you should always develop on a
case-sensitive collation. If you develop on a case-insensitive collation,
and the customer then insists on case-sensitive, you may have a complete
mess to sort out.

Personally, I don't see the point of using MyCamelCase, if you don't
care to remember how you originally defined it.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks for your response. This confirms what we suspected.

Do you have any idea why there is no SQL_Latin1_General_CP1_CS_AI
collation? Can I get it somewhere?

Erland Sommarskog wrote:

Quote:

Originally Posted by

aj (ronald@.mcdonalds.com) writes:

Quote:

Originally Posted by

>A few collation questions on SQL Server 2005 SP2, which I'll call SQLS.
>>
>The default collation for SQLS is apparently SQL_Latin1_General_CP1_CI_AS.


>
The default collation when you install SQL Server depends on your regional
settings. SQL_Latin1_General_CP1_CI_AS is what you get when your regional
settings is English (US).
>

Quote:

Originally Posted by

>I see that there is a Latin1_General_CS_AI. What effects are there
>in using this collation? The SQL_* collations are SQL collations,
>while non-SQL_* collations are Windows collations, yes? SQLS runs
>only on Windows, so am I safe in using Latin1_General_CS_AI? What
>does the CP1 in the SQL collation signify? Am I asking for trouble?


>
You should be fine. About everywhere else in the world when you install SQL
Server, the default collation is a Windows collation. For instance, in my
case it's Finnish_Swedish_CI_AS (but I always change it to
Finnish_Swedish_CS_AS.)
>
Windows collations are drawn from Windows and Unicode, and the sorting for
varchar and nvarchar data is the same (save that nvarchar includes far more
characters). SQL collations on the other hand are completely different
for varchar and nvarchar. For varchar they are just an 8-bit character
set, while for nvarchar they are Unicode. The flip side of this is since
they for varchar only have 255 charcters, operations with varchar are
quite a bit faster with SQL collations than with Windows collations (save
binary collations). However, there are also potential for performance
disasters with SQL collations if you join varchar and nvarchar that
are less likly to occur with Windows collations.
>

Quote:

Originally Posted by

>Assuming that I set Latin1_General_CS_AI (or any other case-sensitive
>collation) at the database level, I believe my DDL/DML for that database
>also becomes case-sensitive. How can I specify that I want ONLY my data
>access to be case-sensitive, and not my DDL/DML? I don't want to have
>to remember to type "select * from MyCamelCase" when "mycamelcase"
>should work.


>
You would have to set the database collation to be one that fits your
preference for identifiers and then explcitly set the collation for each
column to be case-sensitive.
>
My strong recommendation is that you should always develop on a
case-sensitive collation. If you develop on a case-insensitive collation,
and the customer then insists on case-sensitive, you may have a complete
mess to sort out.
>
Personally, I don't see the point of using MyCamelCase, if you don't
care to remember how you originally defined it.
>
>

|||aj (ronald@.mcdonalds.com) writes:

Quote:

Originally Posted by

Do you have any idea why there is no SQL_Latin1_General_CP1_CS_AI
collation?


No. Maybe they never developed this combiniation for SQL collations, but got
it for free with Windows collation. fn_helpcollations tells me that there
are no CS_AI SQL collation at all.

Quote:

Originally Posted by

Can I get it somewhere?


No. There is support for adding collations.

If you feel strongly about it, you can submit a suggestion on
http://connect.microsoft.com/SqlServer/Feedback.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

collation question

Hello
We used MSSQL 2000 ENG - enterprise edition on a Windows 2K SP3 server ENG.
What are differences between SQL_Latin1_General_CP1_CI_AS collation
and Latin1_General_CI_AS collation ?
If I compare with COLLATIONPROPERTY function, results are equals.
Is it possible to install an instance with SQL_Latin1_General_CP1_CI_AS
collation ?
How to dow ?
Thanks.
Alain
> What are differences between SQL_Latin1_General_CP1_CI_AS collation
> and Latin1_General_CI_AS collation ?
They compare non-Unicode (varchar/char) data using different rules. The
Windows collation (Latin1_General_CI_AS) converts all non-Unicode data to
Unicode and then uses the same Unicode string comparison rules that it
uses for Unicode data. The benefit is that consistent rules are used for
both Unicode and non-Unicode string comparisons. The SQL collation
(SQL_Latin1_General_CP1_CI_AS) uses legacy SQL "sort order" rules to
compare non-Unicode data, and a different set of sorting rules for
Unicode data (the same Latin1_General rules that are used by
Latin1_General_CI_AS). The benefit of this is backwards compatibility
with older applications that may rely on the legacy SQL sort order for
non-Unicode data.

> Is it possible to install an instance with
SQL_Latin1_General_CP1_CI_AS
> collation ?
Yes. Do an advanced setup, and on the collation selection dialog click
the "SQL collations" radio button at the bottom of the form, then select
"Dictionary order, case insensitive for use with code page 1252". For
an existing instance, run REBUILDM.EXE and select the same.
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.
Thread-Topic: collation question
thread-index: AcUv7xA8D1swDrfPQriTPAu9nhc9mQ==
X-WBNR-Posting-Host: 213.56.154.227
From: "=?Utf-8?B?QS5HLg==?=" <AG@.discussions.microsoft.com>
Subject: collation question
Date: Wed, 23 Mar 2005 13:27:06 -0800
Lines: 17
Message-ID: <435980C5-2967-4A89-87E0-E3C6DE18F81F@.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.server
Path: TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.sqlserver.server:383050
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
X-Tomcat-NG: microsoft.public.sqlserver.server
Hello
We used MSSQL 2000 ENG - enterprise edition on a Windows 2K SP3 server
ENG.
What are differences between SQL_Latin1_General_CP1_CI_AS collation
and Latin1_General_CI_AS collation ?
If I compare with COLLATIONPROPERTY function, results are equals.
Is it possible to install an instance with SQL_Latin1_General_CP1_CI_AS
collation ?
How to dow ?
Thanks.
Alain

collation question

Hello
We used MSSQL 2000 ENG - enterprise edition on a Windows 2K SP3 server ENG.
What are differences between SQL_Latin1_General_CP1_CI_AS collation
and Latin1_General_CI_AS collation ?
If I compare with COLLATIONPROPERTY function, results are equals.
Is it possible to install an instance with SQL_Latin1_General_CP1_CI_AS
collation ?
How to dow ?
Thanks.
Alain> What are differences between SQL_Latin1_General_CP1_CI_AS collation
> and Latin1_General_CI_AS collation ?
They compare non-Unicode (varchar/char) data using different rules. The
Windows collation (Latin1_General_CI_AS) converts all non-Unicode data to
Unicode and then uses the same Unicode string comparison rules that it
uses for Unicode data. The benefit is that consistent rules are used for
both Unicode and non-Unicode string comparisons. The SQL collation
(SQL_Latin1_General_CP1_CI_AS) uses legacy SQL "sort order" rules to
compare non-Unicode data, and a different set of sorting rules for
Unicode data (the same Latin1_General rules that are used by
Latin1_General_CI_AS). The benefit of this is backwards compatibility
with older applications that may rely on the legacy SQL sort order for
non-Unicode data.
> Is it possible to install an instance with
SQL_Latin1_General_CP1_CI_AS
> collation ?
Yes. Do an advanced setup, and on the collation selection dialog click
the "SQL collations" radio button at the bottom of the form, then select
"Dictionary order, case insensitive for use with code page 1252". For
an existing instance, run REBUILDM.EXE and select the same.
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.
Thread-Topic: collation question
thread-index: AcUv7xA8D1swDrfPQriTPAu9nhc9mQ==X-WBNR-Posting-Host: 213.56.154.227
From: "=?Utf-8?B?QS5HLg==?=" <AG@.discussions.microsoft.com>
Subject: collation question
Date: Wed, 23 Mar 2005 13:27:06 -0800
Lines: 17
Message-ID: <435980C5-2967-4A89-87E0-E3C6DE18F81F@.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.server
Path: TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.sqlserver.server:383050
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
X-Tomcat-NG: microsoft.public.sqlserver.server
Hello
We used MSSQL 2000 ENG - enterprise edition on a Windows 2K SP3 server
ENG.
What are differences between SQL_Latin1_General_CP1_CI_AS collation
and Latin1_General_CI_AS collation ?
If I compare with COLLATIONPROPERTY function, results are equals.
Is it possible to install an instance with SQL_Latin1_General_CP1_CI_AS
collation ?
How to dow ?
Thanks.
Alain

collation question

Hello
We used MSSQL 2000 ENG - enterprise edition on a Windows 2K SP3 server ENG.
What are differences between SQL_Latin1_General_CP1_CI_AS collation
and Latin1_General_CI_AS collation ?
If I compare with COLLATIONPROPERTY function, results are equals.
Is it possible to install an instance with SQL_Latin1_General_CP1_CI_AS
collation ?
How to dow ?
Thanks.
Alain> What are differences between SQL_Latin1_General_CP1_CI_AS collation
> and Latin1_General_CI_AS collation ?
They compare non-Unicode (varchar/char) data using different rules. The
Windows collation (Latin1_General_CI_AS) converts all non-Unicode data to
Unicode and then uses the same Unicode string comparison rules that it
uses for Unicode data. The benefit is that consistent rules are used for
both Unicode and non-Unicode string comparisons. The SQL collation
(SQL_Latin1_General_CP1_CI_AS) uses legacy SQL "sort order" rules to
compare non-Unicode data, and a different set of sorting rules for
Unicode data (the same Latin1_General rules that are used by
Latin1_General_CI_AS). The benefit of this is backwards compatibility
with older applications that may rely on the legacy SQL sort order for
non-Unicode data.

> Is it possible to install an instance with
SQL_Latin1_General_CP1_CI_ASeen">
> collation ?
Yes. Do an advanced setup, and on the collation selection dialog click
the "SQL collations" radio button at the bottom of the form, then select
"Dictionary order, case insensitive for use with code page 1252". For
an existing instance, run REBUILDM.EXE and select the same.
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.
Thread-Topic: collation question
thread-index: AcUv7xA8D1swDrfPQriTPAu9nhc9mQ==
X-WBNR-Posting-Host: 213.56.154.227
From: "examnotes" <AG@.discussions.microsoft.com>
Subject: collation question
Date: Wed, 23 Mar 2005 13:27:06 -0800
Lines: 17
Message-ID: <435980C5-2967-4A89-87E0-E3C6DE18F81F@.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.server
Path: TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.sqlserver.server:383050
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
X-Tomcat-NG: microsoft.public.sqlserver.server
Hello
We used MSSQL 2000 ENG - enterprise edition on a Windows 2K SP3 server
ENG.
What are differences between SQL_Latin1_General_CP1_CI_AS collation
and Latin1_General_CI_AS collation ?
If I compare with COLLATIONPROPERTY function, results are equals.
Is it possible to install an instance with SQL_Latin1_General_CP1_CI_AS
collation ?
How to dow ?
Thanks.
Alain

Collation problem (please help)

Hi,

when I install SQL Server it uses a SQL collation (SQL_Latin1_General_CP1_CI_AS), and i created a form haveing Arabic field names and every thing saved on my DataBase, when i call this field to the html page its look fine and visitor can read it , the problem when the clintes (visitors) fill this form and submit it, I can't read the information enterd in the text fields its shown like this (?).

can any one help

YOu will have to insert the values indicating that unicode is inserted. If you are composing your own insert statements, make sure you are using something like N'HereisUnicode' whereas the prefacing N indicated the Unicode character. Unicode data can be stored in unicode data types like Nvarchar etc. If you are no composing your statements on the fly and do parametrized queries (preferable) you should be aware of using the appropiate SQL unicode datatypes (mentioned above)

Jens K. Suessmeyer

http://www.sqlserver2005.de
|||

I'll try that,

thank you alot.