
One catch that I’ve been trying to work around this week – if this is for a IIS/.Net web page using a SqlDataSource (or maybe it’s called a sqlDataControl), the object will NOT use views properly.

It was a fun post to write.Ĭomment by Michael J. One suggestion is to use the user-settable performance counter via sp_increment_counter1 then Poof! You’ve got your own deprecated-features performance counter just like Microsoft.Īwesome post. You can log or track trigger use using any way you’re comfortable with. Just add some logging statement to the definition of the triggers. You can still make sure gradually by logging whenever someone uses the old schema. The applications can transition gradually to the new way of doing things.Įven if you believe every application uses only the new schema.
CREATE TRIGGER AFTER 100 UPDATES FREE

Probably an insert that is in progress.Charlie = Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION If you try to create the trigger then go another window in ssms and typeEXEC sp_who2You will probably see that it is blocked by another process.
CREATE TRIGGER AFTER 100 UPDATES UPDATE
Any theories? I have a DDL_DATABASE_LEVEL_EVENTS trigger on the live database, would this block normal triggers? Do I need to disable the DDL trigger?īlocked by a currently running insert / update / delete?Post the code?not really enough information here.Charlie = Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTIONĭon't think there is a bug in trigger since it works on other databases /servers, so I tried a simple trigger which just displays a message, and it hangs also:CREATE trigger TRG_teston myTablefor insert as begin print 'Row Inserted' end Here is my DDL Trigger based on: TRIGGER ON DATABASE FOR DDL_DATABASE_LEVEL_EVENTS AS DECLARE XML SET = EVENTDATA() IF 'nvarchar(100)') 'CREATE_STATISTICS' AND 'nvarchar(100)') 'UPDATE_STATISTICS' INSERT INTO ( EventType, ObjectName, ObjectType,, Session_IPAddress ) SELECT 'nvarchar(100)'), 'nvarchar(100)'), 'nvarchar(100)'), 'nvarchar(max)'), client_net_address FROM sys.dm_exec_connections WHERE GOSET ANSI_NULLS OFFGOSET QUOTED_IDENTIFIER OFFGODISABLE TRIGGER ON DATABASEGOENABLE TRIGGER ON DATABASEGO I have made a new trigger, tested it on a test server and it works fine, tested it on a test database on live server and that works fine, but on the live database it just hangs when running create statement. We've got lots of great SQL ServerĮxperts to answer whatever question you can come up with.
