I am trying to control the table access permission using trigger based on application, but system is throwing error message.
Here is the code
CREATE TRIGGER [Tr_ServerLogon]
ON ALL SERVER FOR LOGON
AS
BEGIN
declare @appname VARCHAR(512)
SET @appname = APP_NAME()
if ('.Net SqlClient Data Provider'=@appname)
GRANT DELETE ON [ArgonSar].[dbo].[customerMaster] TO [weaveit]
else
DENY DELETE ON [ArgonSar].[dbo].[customerMaster] TO [weaveit]
END
GO
Please suggest me, what I should do.