Le Kevin dot com

photographic-poetic-musical horizon

Browsing Posts 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:

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.

Use DatabaseName ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO ALTER DATABASE DatabaseName SET MULTI_USER GO

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 tables and shrink Logs and Data Files in Server — ============================================= CREATE PROCEDURE [dbo].[spShrinkAllDatabases] AS BEGIN SET NOCOUNT ON; DECLARE @dbname [...]

Download Prepared CA Tax July 1, 2011 here… Statewide Base Tax Rate Decreases from 8.25% to 7.25% Effective July 1, 2011, the one percent sales and use tax rate increase that was approved with the state budget and effective April 1, 2009, will expire lowering the statewide base tax rate from 8.25 percent to 7.25 [...]

SELECT ROUTINE_NAME, ROUTINE_DEFINITION,* FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE ‘%scope_identity()%’
AND ROUTINE_TYPE=’PROCEDURE’