February 1, 2008 at 8:33 am
Can anyone help me on how to Encrypt a trigger and possibly give me an example code on how to do it?
Thank you
Wayne
Wayne Benhart
February 1, 2008 at 8:46 am
Wayne Benhart (2/1/2008)
Can anyone help me on how to Encrypt a trigger and possibly give me an example code on how to do it?Thank you
Wayne
You could just use the "WITH ENCRYPTION" when you create the trigger. For example:
CREATE TABLE mytable ( a INT )
GO
CREATE TRIGGER mytable_trigger ON mytable
WITH ENCRYPTION
AFTER INSERT
AS
PRINT 'hi'
GO
Note that the encryption on SQL Server 2000 is a joke, and many tools will happily decrypt these objects for you. SQL Server 2005 addresses this, and it is more difficult to decrypt these objects, but is still possible. So, while you will be able to hide the contents from the most basic users, you will also make your database more difficult to maintain.
Regards,
Andras
February 7, 2008 at 9:39 pm
Andras Belokosztolszki (2/1/2008)
You could just use the "WITH ENCRYPTION" when you create the trigger. For example:
CREATE TABLE mytable ( a INT )
GO
CREATE TRIGGER mytable_trigger ON mytable
WITH ENCRYPTION
AFTER INSERT
AS
PRINT 'hi'
GO
OK, I've tried to put the 'WITH ENCRYPTION' in my create statement but I keep getting an error.
Here is my statement... how would I add it to this create statement?
CREATE TRIGGER [dbo.GLTRANSBATCH_Dept_Change_Ins] ON [dbo].[GLTRANSBATCH] FOR INSERT NOT FOR REPLICATION AS
Thank you,
Wayne
Wayne Benhart
February 7, 2008 at 10:21 pm
CREATE TRIGGER [dbo.GLTRANSBATCH_Dept_Change_Ins]
ON [dbo].[GLTRANSBATCH]
with encryption
FOR INSERT NOT FOR REPLICATION AS
-- your trigger logic...
What error you have?
February 11, 2008 at 5:51 am
I tried it again and it workd fine... Not sure what I was doing different to cause the error.
Thank you,
Wayne
Wayne Benhart
May 19, 2010 at 1:00 am
Thanx dear , it is good plateform for beginners
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply