SQL SERVER – 2005 Change Database Compatible Level – Backward Compatibility

sp_dbcmptlevel Sets certain database behaviors to be compatible with the specified version of SQL Server. Example: ----SQL Server 2005 database compatible level to SQL Server 2000 EXEC sp_dbcmptlevel AdventureWorks, 80; GO ----SQL Server 2000 database compatible level to SQL Server 2005 EXEC sp_dbcmptlevel AdventureWorks, 90; GO Version of SQL Server…
Read More

SQL SERVER – Stored Procedure to display code (text) of Stored Procedure, Trigger, View or Object

This is another popular question I receive. How to see text/content/code of Stored Procedure. System stored procedure that prints the text of a rule, a default, or an unencrypted stored procedure, user-defined function, trigger, or view. Syntax sp_helptext @objname = 'name' sp_helptext [ @objname = ] 'name' [ , […
Read More

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