Category: 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

INSTEAD OF DELETE

INSTEAD OF DELETE triggers can be defined on a view or table to replace the standard action of the DELETE statement. Usually, the INSTEAD OF DELETE trigger is defined on a view to modify data in one or more base tables.

0

DB procedure to shrink all databases

USE [master] GO /****** Object: StoredProcedure [dbo].[spShrinkAllDatabases] Script Date: 08/12/2011 15:40:15 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO — ============================================= — Author: Dan Sutton — Create date: 06/14/2011 — Description: Reindex all...