[youtube=http://www.youtube.com/watch?v=zPmL0z_aspo]
Here is the code used in the video.
USE TempDB
GO
-- Sample Data Building
CREATE TABLE ColTable
(Col1 VARCHAR(15) COLLATE Latin1_General_CI_AS,
Col2 VARCHAR(14) COLLATE Latin1_General_CS_AS) ;
INSERT ColTable(Col1, Col2)
VALUES ('Apple','Apple'),
('apple','apple'),
('pineapple','pineapple'),
('Pineapple','Pineapple');
GO
-- Retrieve Data
SELECT *
FROM ColTable
GO
-- Retrieve Data
SELECT *
FROM ColTable
ORDER BY Col1
GO
-- Retrieve Data
SELECT *
FROM ColTable
ORDER BY Col2
GO
-- Clean up
DROP TABLE ColTable
GO
Related Tips in SQL in Sixty Seconds:
- SQL SERVER – Effect of Case Sensitive Collation on Resultset
- Example of Width Sensitive and Width Insensitive Collation
- Collation and Collation Sensitivity – Quiz – Puzzle – 6 of 31
- Change Collation of Database Column – T-SQL Script
- Find Collation of Database and Table Column Using T-SQL
- Default Collation of SQL Server 2008
- Cannot resolve collation conflict for equal to operation
If we like your idea we promise to share with you educational material.
Reference: Pinal Dave (https://blog.sqlauthority.com)
1 Comment. Leave new
Happy Vinayaka Chavithi Pinal…
Thanks for your valuable posts….