|
|
|
Click here to copy the following block |
SELECT * FROM ::fn_helpcollations() WHERE [name] LIKE 'SQL_Latin%';
GO
SELECT SERVERPROPERTY( 'Collation' ) AS Server_Default_Collation;
GO
CREATE DATABASE CollateTestDB COLLATE SQL_Latin1_General_CP850_BIN; GO USE CollateTestDB; GO
SELECT DATABASEPROPERTYEX( 'CollateTestDB' , 'Collation' ) AS Database_Default_Collation
GO
CREATE TABLE Tbl1 ( Col1 char( 10 ) NOT NULL , Col2 varchar( 10 ) NULL ); INSERT INTO Tbl1 VALUES( 'a' , 'b' ); INSERT INTO Tbl1 VALUES( 'A' , 'B' ); GO
GO
SELECT * FROM Tbl1 WHERE Col1 = 'a' And Col2 = 'b';
GO
SELECT * FROM Tbl1 WHERE Col1 COLLATE SQL_Latin1_General_CP850_CI_AI = 'a' And Col2 COLLATE SQL_Latin1_General_CP850_CI_AI = 'b';
CREATE TABLE Tbl2 ( Col1 char( 10 ) COLLATE SQL_Latin1_General_CP850_CS_AS NOT NULL , Col2 varchar( 10 ) COLLATE SQL_Latin1_General_CP850_CI_AI NULL ); INSERT INTO Tbl2 VALUES( 'a' , 'b' ); INSERT INTO Tbl2 VALUES( 'A' , 'B' ); GO
GO
SELECT * FROM Tbl2 WHERE Col1 = 'a';
SELECT * FROM Tbl2 WHERE Col2 = 'b';
SELECT * INTO #Tbl1 FROM Tbl1; EXEC( 'Use Tempdb EXEC sp_help ''#Tbl1'''); DROP TABLE #Tbl1;
Go
SELECT Col1 COLLATE SQL_Latin1_General_CP437_CI_AS AS Col1, Col2 COLLATE SQL_Latin1_General_CP437_CI_AS AS Col2 INTO #Tbl1 FROM Tbl1; EXEC( 'Use Tempdb EXEC sp_help ''#Tbl1'''); DROP TABLE #Tbl1;
Go
CREATE TABLE #Tbl1 ( Col1 char( 10 ) NOT NULL , Col2 varchar( 10 ) NULL ); EXEC( 'Use Tempdb EXEC sp_help ''#Tbl1'''); DROP TABLE #Tbl1;
Go
CREATE TABLE #Tbl1 ( Col1 char( 10 ) COLLATE database_default NOT NULL , Col2 varchar( 10 ) COLLATE database_default NULL ); EXEC( 'Use Tempdb EXEC sp_help ''#Tbl1'''); DROP TABLE #Tbl1;
Go
USE master; DROP DATABASE CollateTestDB; GO |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|