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
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:
If you are working with SQL server CLR objects there’s a higher possibility that you might encounter the following error. “Msg 6263, Level 16, State 1, Line 1 Execution of user code in the...