[dba-SQLServer]Trigger problem

Michael Brosdorf michael.broesdorf at web.de
Thu Jul 17 09:56:31 CDT 2003


Dear group,

I have a strange problem with a trigger on a view. The trigger is an instead
of trigger for deletes.
If I work with the view/table from within my application or SQL Analyzer,
everything works fine (in that case,
deletes through the view are cancelled).

But, if I open the view in the Enterprise Manager, I can delete rows from
the view. Now, that makes me think that something is not set up right...

Here are the scripts:


CREATE TABLE [Table1] (
	[Test_ID] [int] NULL
) ON [PRIMARY]
GO

INSERT INTO Table1 values(1)
INSERT INTO Table1 values(2)
INSERT INTO Table1 values(3)


CREATE VIEW dbo.vueTest
AS
SELECT     *
FROM         dbo.Table1

CREATE TRIGGER [vueTest_Trig_D] ON vueTest
INSTEAD OF  DELETE
AS
raiserror ('Nonono!!',16,10)

Any ideas?

Michael



More information about the dba-SQLServer mailing list