SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 what is the use of sql_latin1_general_cp1_ci_as
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

coolbudy
Starting Member

2 Posts

Posted - 12/06/2012 :  03:55:13  Show Profile  Reply with Quote
what is the use of sql_latin1_general_cp1_ci_as in sql server 2008

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 12/06/2012 :  04:06:05  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
As opposed to what?
It's a collation - depends on how you want to use the data as to which you need to use.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

coolbudy
Starting Member

2 Posts

Posted - 12/06/2012 :  04:18:09  Show Profile  Reply with Quote
quote:
Originally posted by nigelrivett

As opposed to what?
It's a collation - depends on how you want to use the data as to which you need to use.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.



You have any simple example for it?
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2170 Posts

Posted - 12/06/2012 :  04:44:46  Show Profile  Reply with Quote
SQL_Latin1_General_CP1_CI_AS

Latin1_General tellls us that the supported language is English.
CP1 - Stand for code page 1
There is no BIN in the collation name that means it supports Dictionary sorting.

in Dictionary Sorting; comparison of character data is based on dictionary order ('A' and 'a' < 'B' and 'b').

Dictionary order is default when no other ordering is defined explicitly.


If you see collation with BIN (e.g. Latin_1_General_BIN ) that means it will support binary sorting, In binary sorting; sorting is based on binary represenation of underlying characters ('A' < 'B' < 'a' < 'b').

CI means character data is case insensitive (that mean 'ABC' = 'abc').

AS means character data is accent sensitive ('à' <> 'ä').


--English characters will be sorted first as r default collation for the column is  SQL_Latin1_General_CP1_CI_AS
create table t
(
	ID	int identity(1,1) primary key,
	data	nvarchar(30)
)
go

insert into t
select N'ABC'
union all 
select N'PQR'
union all
select N'??????'
union all
select N'aaa'
union all
select N'?? ???? ???'
union all
select N'??? ????
'
select * from t order by data

DROP TABLE t

CREATE TABLE dbo.CollationDemo(
	Latin1_General_CI_AS varchar(10) COLLATE Latin1_General_CI_AS
	,SQL_Latin1_General_CP1_CI_AS varchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS
	);

INSERT INTO dbo.CollationDemo VALUES('CO-OP', 'CO-OP');
INSERT INTO dbo.CollationDemo VALUES('COOP', 'COOP');

SELECT *
FROM dbo.CollationDemo
ORDER BY Latin1_General_CI_AS;

SELECT *
FROM dbo.CollationDemo
ORDER BY SQL_Latin1_General_CP1_CI_AS;

DROP TABLE dbo.CollationDemo




--
Chandu
Go to Top of Page

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 12/06/2012 :  04:55:34  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
quote:
Originally posted by coolbudy

quote:
Originally posted by nigelrivett

As opposed to what?
It's a collation - depends on how you want to use the data as to which you need to use.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.



You have any simple example for it?



select *
from tbl
where col1 = col2 collate SQL_Latin1_General_CP1_CI_AS

Why do you pick this out in particular? You wouldn't be interested in it unless it was a business requirement in which case you would have to know what collations are.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000