Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COLLATE SQL_Latin1_General .....

Status
Not open for further replies.

atojaf

Programmer
Mar 7, 2006
18
US
I created a couple of tables on my SQL Server using the wizard. Then, I generated the sql scripts to be outputted on a *.sql file. My question is, what is the meaning of "COLLATE SQL_Latin1_General_CP1_CI_AS" at the end of each sql script block? thanks a lot.
 
Generally speaking, this is "safe cr@p" generated by wizard. If collation is not specified, database default is assumed. Ditto if you use [!]COLLATE database_default[/!] instead.

Collations in a nuthsell:
Code:
select description 
from ::fn_helpcollations() 
where name = 'SQL_Latin1_General_CP1_CI_AS'

- SQL_ - SQL collation
- Latin1_General_CP1 - accepts most of characters from Western alphabets (ISO code page 1252).
- CI - case-insensitive ('Blah' is equal to 'BLAH' in comparisons)
- AS - accent-sensitive, makes sense for alphabets with accented characters (in German U is different than Ü)

Some collations also have Kana-sensitivity (Japanese) or width-sensitivity flag (common for Eastern European alphabets)

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
Thanks very much. This is very helpful for me. I basically created a unix script to remove "COLLATION....." from the outputted Sql Server script so that I can ran the same script to a Oracle server.
 
One more thing, so basically if I remove the "COLLATE SQL_Latin1_General_CP1_CI_AS" and it will still be ok since we are in the states. I mean we are using western codes?
 
If that collation is DB/server's default (and AFAIK it is usually), I'd say you are 100% safe.

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
ok thanks Vongrunt. By the way, I using it for basically to practice populating my Oracle server with tables that are already existing from my SQL server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top