SELECT TH_BIN FROM TCollation ORDER BY TH_BIN
SELECT TH_BIN2 FROM TCollation ORDER BY TH_BIN2
SELECT TH_CIAI FROM TCollation ORDER BY TH_CIAI
SELECT TH_CIAS FROM TCollation ORDER BY TH_CIAS
SELECT TH_CSAI FROM TCollation ORDER BY TH_CSAI
SELECT TH_CSAS FROM TCollation ORDER BY TH_CSAS
SELECT TH_BIN FROM TCollation WHERE TH_BIN Like N'ทิพย%'
SELECT TH_BIN2 FROM TCollation WHERE TH_BIN2 Like N'ทิพย%'
SELECT TH_CIAI FROM TCollation WHERE TH_CIAI Like N'ทิพย%'
SELECT TH_CIAS FROM TCollation WHERE TH_CIAS Like N'ทิพย%'
SELECT TH_CSAI FROM TCollation WHERE TH_CSAI Like N'ทิพย%'
SELECT TH_CSAS FROM TCollation WHERE TH_CSAS Like N'ทิพย%'
SELECT TH_BIN FROM TCollation WHERE TH_BIN Like N'ทิพย์%'
SELECT TH_BIN2 FROM TCollation WHERE TH_BIN2 Like N'ทิพย์%'
SELECT TH_CIAI FROM TCollation WHERE TH_CIAI Like N'ทิพย์%'
SELECT TH_CIAS FROM TCollation WHERE TH_CIAS Like N'ทิพย์%'
SELECT TH_CSAI FROM TCollation WHERE TH_CSAI Like N'ทิพย์%'
SELECT TH_CSAS FROM TCollation WHERE TH_CSAS Like N'ทิพย์%'
เลยทำให้อยากรู้ว่า นอกจากตัวการันต์แล้ว ยังมีตัวอื่นๆ หรือไม่ที่ AI ไม่สนใจ
เลยทดลองด้วย "ไข่" (ไม้เอก)
Code
SELECT TH_BIN FROM TCollation WHERE TH_BIN Like N'ไข่%'
SELECT TH_BIN2 FROM TCollation WHERE TH_BIN2 Like N'ไข่%'
SELECT TH_CIAI FROM TCollation WHERE TH_CIAI Like N'ไข่%'
SELECT TH_CIAS FROM TCollation WHERE TH_CIAS Like N'ไข่%'
SELECT TH_CSAI FROM TCollation WHERE TH_CSAI Like N'ไข่%'
SELECT TH_CSAS FROM TCollation WHERE TH_CSAS Like N'ไข่%'
SELECT TH_BIN FROM TCollation WHERE TH_BIN Like N'b%'
SELECT TH_BIN2 FROM TCollation WHERE TH_BIN2 Like N'b%'
SELECT TH_CIAI FROM TCollation WHERE TH_CIAI Like N'b%'
SELECT TH_CIAS FROM TCollation WHERE TH_CIAS Like N'b%'
SELECT TH_CSAI FROM TCollation WHERE TH_CSAI Like N'b%'
SELECT TH_CSAS FROM TCollation WHERE TH_CSAS Like N'b%'
ว่าจะจบล่ะ
เอาอีกตัวให้สิ้นสงสัยไปเลยว่า AI ไม่สนใจไม้เอก (เข้าใจว่า ไม่สนใจพวกวรรณยุกต์ทั้งหลายด้วย)
SELECT TH_BIN FROM TCollation WHERE TH_BIN Like N'ไขเลือด%'
SELECT TH_BIN2 FROM TCollation WHERE TH_BIN2 Like N'ไขเลือด%'
SELECT TH_CIAI FROM TCollation WHERE TH_CIAI Like N'ไขเลือด%'
SELECT TH_CIAS FROM TCollation WHERE TH_CIAS Like N'ไขเลือด%'
SELECT TH_CSAI FROM TCollation WHERE TH_CSAI Like N'ไขเลือด%'
SELECT TH_CSAS FROM TCollation WHERE TH_CSAS Like N'ไขเลือด%'
- Set the restrict access of the database to SINGLE_USER (note the you might kill all the active sessions)คลิก OK
2. คลิกขวาที่ ชื่อdatabase >> properties >> Options >>
-Change the collation of database to whatever you want it คลิก OK
3.คลิกขวาที่ ชื่อdatabase >> properties >> Options >>
- And switch back the restrict access of the database to MULTI_USER คลิก OK
หรือท่านจะรันquery ก้ได้ดังนี้
ALTER DATABASE [database_name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE [database_name] COLLATE [desired collation]
ALTER DATABASE [database_name] SET MULTI_USER