How to Restrict Particular Table Delete Query

Posted by Jayakumars under Regular Expressions on 8/9/2011 | Points: 10 | Views : 2597 | Status : [Member] [MVP] | Replies : 2
hi

How to Restrict Delete records Particular Table



For Ex : My table structure below here

GO
/****** Object: Table [dbo].[Tb_Test123] Script Date: 08/09/2011 12:43:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Tb_Test123](
[id] [int] IDENTITY(1,1) NOT NULL,
[Enames] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_Tb_Test123] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF



i have create one table table name Tb_Test123 but no relationship but i need
this table only i need donot execute delete query
any one pass delete from Tb_Test123 did not execute in my db this i need
how do achieve this.

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

Posted by: Mcadeepuraj on: 8/9/2011 [Member] Starter | Points: 25

Up
0
Down
you can use insteed of trigger for this

Deepak Kumar

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 8/9/2011 [Member] Bronze | Points: 25

Up
0
Down
Yes,
you can restrict this by using Instead Of triggers

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response