SQL SERVER – 2005 Understanding Trigger Recursion and Nesting with examples

Trigger events can be fired within another trigger action. One Trigger execution can trigger even on another table or same table. This trigger is called NESTED TRIGGER or RECURSIVE TRIGGER. Nested triggers SQL Server supports the nesting of triggers up to a maximum of 32 levels. Nesting means that when…
Read More

SQL SERVER – 2005 – SSMS Change T-SQL Batch Separator

I recently received one big file with many T-SQL batches. It was a very big file and I was asked that this file was tested many times and it can run one transaction. I noticed the separator of the batches is not GO but it was EndBatch. I have followed two options to run the whole batch in one transaction. Let us learn how to change T-SQL Batch Separator.

Read More

SQL SERVER – Disable Index – Enable Index – ALTER Index

There are few requirements in real world when Index on table needs to be disabled and re-enabled afterwards. e.g. DTS, BCP, BULK INSERT etc. Index can be dropped and recreated. I prefer to disable the Index if I am going to re-enable it again. USE AdventureWorks GO ----Diable Index ALTER INDEX [IX_StoreContact_ContactTypeID]…
Read More