Tagged: clr

0

Manually create assembly to MS database

ALTER DATABASE DBNAME SET TRUSTWORTHY ON GO EXEC sp_changedbowner ‘sa’ GO CREATE ASSEMBLY [ASSEMBLYNAME] AUTHORIZATION dbo FROM ‘E:\ASSEMBLYNAME\bin\Debug\ASSEMBLYNAME.dll’ WITH PERMISSION_SET = UNSAFE GO CREATE PROCEDURE [dbo].[spASSEMBLYPROCEDURE] AS EXTERNAL NAME [ASSEMBLYNAME].[StoredProcedures].[spASSEMBLYPROCEDURE] GO

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: