NetInverse Developers Blog

March 8, 2009
Category: SQL — Tags: — admin @ 12:04 am

You may want to check out this list of the deprecated features in SQL 2005.

I noticed that DBCC DBREINDEX is one on the list. SQL 2005 introduces a new REBUILD option to the ALTER INDEX command to replace it. This new REBUILD option can perform online or offline re-indexing operations.

DBCC DBREINDEX can only perform offline reindexing.

Category: SQL — Tags: — admin @ 12:02 am

Normally you use the trigger functionality with Data Manipulation Language (DML) commands such as INSERT, UPDATE, and DELETE. Now SQL 2005 introduces new Data Definition Language (DDL) triggers. You can use it to audit schema changes.

Example of DDL Trigger:

    CREATE TRIGGER safety
    ON DATABASE
    FOR DROP_TABLE, ALTER_TABLE
    AS
    PRINT ‘You must disable Trigger “safety” to drop or alter tables!’
    ROLLBACK;

    DISABLE TRIGGER safety ON DATABASE;

Please refer to MSDN for details: MSDN: Designing DDL Triggers.
An articel about using DDL triggers: Using SQL Server 2005 to document Sarbanes-Oxley compliance

« Newer Posts

©2009 NetInverse. All rights reserved. Powered by WordPress