Tagged: Database

0

MSSQL: Remove Diacritic Marks From Characters – Vietnamese unicode to non-unicode in database

Sometimes we want to remove accents from vietnamese words to Latin based characters for search or matching routine in database. However, Microsoft SQL Database does not offer normalized function which we can use to remove accents from words such as:

AI ĐI TRÊN DÀM ĐƯỜNG TRƯỜNG => AI DI TREN DAM DUONG TRUONG
ÁO EM CHƯA MÀC MỘT LẦN => AO EM CHUA MAC MOT LAN

Good thing, there is a workaround by using CLR function, please example code below:






0

Shrink log size in sql database

To shrink the file size I use the following script: Use DBName Go exec sp_dboption DBName, ‘trunc. log on chkpt.’, true checkpoint DBCC SHRINKFILE (N’DBNameFileName, 0); exec sp_dboption DBName, ‘trunc. log on chkpt.’, false