 |
|
 |
|
Next: SQL Table Partition
|
| Author |
Message |
External

Since: Mar 05, 2008 Posts: 29
|
(Msg. 1) Posted: Tue Aug 12, 2008 10:17 am
Post subject: error adding user when audit trigger applied Archived from groups: microsoft>public>sqlserver>programming (more info?)
|
|
|
Hi I have a trigger that will audit all ddl events. When adding a user
through SSMS and give the user permission to certain databases only not all
databases I get the error below. If I grant access using the code below
CREATE USER [Titan\john.dow] FOR LOGIN [Titan\john.dow]
EXEC sp_addrolemember N'db_datareader', N'Titan\john.dow'
It works totally fine no error messages. Has nayone else had this issue?
thanks for any advice Sammy
Error Msg:
CONDITIONAL failed because the following SET
options have incorrect settings: 'ARITHABORT'.
Verify that SET options are correct for use with indexed views and/or
indexes on computed columns
and/or query notifications and/or xml data type methods. (.Net SqlClient
Data Provider)
DDL Trigger:
create TRIGGER [TitanDDLTriggerAudit]
ON DATABASE
for DDL_DATABASE_LEVEL_EVENTS
AS
BEGIN
DECLARE @data XML
SET @data = EVENTDATA()
IF @data.value('(/EVENT_INSTANCE/EventType)[1]', 'nvarchar(100)')
<> 'CREATE_STATISTICS'
if @data.value('(/EVENT_INSTANCE/EventType)[1]', 'nvarchar(100)')
<> 'UPDATE_STATISTICS'
INSERT dbo.ddlTitanLog
(PostTime, DB_User,DBname, Event, TSQL)
VALUES (GETDATE(), CONVERT(nvarchar(100),
SUSER_NAME()),CONVERT(nvarchar(100),DB_NAME()),
@data.value('(/EVENT_INSTANCE/EventType)[1]',
'nvarchar(100)'),
@data.value('(/EVENT_INSTANCE/TSQLCommand)[1]', 'nvarchar(2000)') )
end >> Stay informed about: error adding user when audit trigger applied |
|
| Back to top |
|
 |  |
External

Since: Aug 12, 2008 Posts: 7
|
(Msg. 2) Posted: Tue Aug 12, 2008 11:01 am
Post subject: RE: error adding user when audit trigger applied [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
sp_configure 'user options', 64
reconfigure
"Sammy" wrote:
> Hi I have a trigger that will audit all ddl events. When adding a user
> through SSMS and give the user permission to certain databases only not all
> databases I get the error below. If I grant access using the code below
>
> CREATE USER [Titan\john.dow] FOR LOGIN [Titan\john.dow]
> EXEC sp_addrolemember N'db_datareader', N'Titan\john.dow'
>
> It works totally fine no error messages. Has nayone else had this issue?
>
> thanks for any advice Sammy
>
> Error Msg:
> CONDITIONAL failed because the following SET
> options have incorrect settings: 'ARITHABORT'.
> Verify that SET options are correct for use with indexed views and/or
> indexes on computed columns
> and/or query notifications and/or xml data type methods. (.Net SqlClient
> Data Provider)
>
> DDL Trigger:
>
> create TRIGGER [TitanDDLTriggerAudit]
>
> ON DATABASE
>
> for DDL_DATABASE_LEVEL_EVENTS
>
> AS
>
> BEGIN
>
> DECLARE @data XML
>
> SET @data = EVENTDATA()
>
> IF @data.value('(/EVENT_INSTANCE/EventType)[1]', 'nvarchar(100)')
>
> <> 'CREATE_STATISTICS'
>
> if @data.value('(/EVENT_INSTANCE/EventType)[1]', 'nvarchar(100)')
>
> <> 'UPDATE_STATISTICS'
>
>
> INSERT dbo.ddlTitanLog
>
> (PostTime, DB_User,DBname, Event, TSQL)
>
> VALUES (GETDATE(), CONVERT(nvarchar(100),
>
> SUSER_NAME()),CONVERT(nvarchar(100),DB_NAME()),
> @data.value('(/EVENT_INSTANCE/EventType)[1]',
>
> 'nvarchar(100)'),
>
> @data.value('(/EVENT_INSTANCE/TSQLCommand)[1]', 'nvarchar(2000)') )
>
> end
> >> Stay informed about: error adding user when audit trigger applied |
|
| Back to top |
|
 |  |
| Related Topics: | Create Trigger for Audit into one talble - Hello Our client would like to write all table data changes to one audit table (i.e. INSERT?UPDATE/DELETE) of every record in one table column numbered COLUMN1-COLUMN50, including UserID, DateTimeStamp, TableName and Type of change (I,U,D) Is there a....
AFTER UPDATE trigger: rollback the update on error within .. - I have a simple trigger which runs an INSERT into an audit table whenever my primary table is updated. The problem is: if an error occurs during this audit insert statement, the audit data is not captured but the initial update still takes effect. Is..
Trigger error trap? - Greetings I have the following insert trigger that I suspect is failing intermittently. I am looking for a best practice to catch the failure. CREATE TRIGGER [tr_Wip_EmpWip_Insert] ON [dbo].[WIP] FOR INSERT AS INSERT INTO EmpWip (TROJANID,..
What happens when a "NULL" condition is applied to the - Hi, I have below two tables "TAB1" & "TAB2": TAB1 ---- T1C1 T1C2 ---- ---- 1 A 2 B 3 C TAB2 ---- T2C1 T2C2 ---- ---- 2 D 3 E 4 F When I executed the below sql statement, it displayed the Cartesian product ...
can pivot be applied to group by ? - For this table Id bigint identity(1,1) Attribute nvarchar(50) not null PeriodNumber bigint not null DataDateTime DateTime not null Value decimal(18,5) not null I need to retrieve each period as a row with its columns as a set of attributes' values. ... |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|