September 18, 2009 at 5:07 am
can somebody help me with a code that prevent data to be deleted from a table please
September 18, 2009 at 5:18 am
instead of trigger will do?
---------------------------------------------------------------------------------
September 18, 2009 at 5:19 am
... nothing or raise an error within the trigger to show the caller that something was wrong.
September 18, 2009 at 5:21 am
CREATE Trigger [dbo].[tr_UsrUsers_Audit] on [dbo].[USR_USERS] for insert, update, delete
as.........
Check BOL for a detailed explanation -but a Trigger is the way to go.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
September 18, 2009 at 5:23 am
CREATE TRIGGER prevent_delete ON yourtablecolumn INSTEAD OF DELETE
AS
BEGIN
RAISERROR ('')
END
GO
---------------------------------------------------------------------------------
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply