Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 DELETE TRIGGER

Author  Topic 

GenerationWithoutName
Starting Member

26 Posts

Posted - 2002-07-30 : 23:35:05
I have Table like this :
CREATE TABLE tblData
( ID Int Primary Key,
Name varchar(35) Null,
IsPosted Char(1) Default('0'),
)

Can i Cancel any Delete Action on "tblData" only when
field "IsPosted" value = "1" ...???
Can i use Delete Trigger and how ???

Please, ... please... help me

DIJE

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2002-07-30 : 23:45:40
DIJE

Do you have BOL (Books On Line) installed?
If Not.. Install
If Yes.. Read!!!!!


CREATE TRIGGER trtblData_StopDelete
ON tblData
FOR DELETE
AS
IF EXISTS(SELECT 1 FROM Inserted WHERE IsPosted = '1')
ROLLBACK TRANSACTION




DavidM

"SQL-3 is an abomination.."
Go to Top of Page
   

- Advertisement -