devxlogo

Using INSTEAD OF In Place of Triggers In SQL Server 2000

The new INSTEAD OF functionality is not exactly like a trigger, but similar. Unlike AFTER triggers, the INSTEAD OF trigger replaces the incoming transaction data modification statement with its own code segment. This can be demonstrated with the following example. We first define a simple table:

 CREATE TABLE TestTBL(	id	INT NOT NULL IDENTITY,	msg	INT NOT NULL );GO;


Now we define an INSTEAD OF trigger.

 CREATE TRIGGER trgIntercepted ON TestTBL INSTEAD OF INSERTASDECLARE	@ret_msg	AS	VARCHAR(100);SET @ret_msg =

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Five Early Architecture Decisions That Quietly Get Expensive

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.