When I am trying to run Extended Event:
CREATE EVENT SESSION [Loading] ON SERVER
ADD EVENT sqlserver.sql_statement_completed(SET collect_statement=(1))
ADD TARGET package0.event_file(SET filename=N'C:\Users\user\Documents\test.xel',max_file_size=(10))
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=3 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
GO
on SQL Server 2016, I get:
The target, "5B2DA06D-898A-43C8-9309-39BBBE93EBBD.package0.event_file", encountered a configuration error during initialization. Object cannot be added to the event session. The operating system returned error 5: 'Access is denied. ' while creating the file 'C:\Users\user\Documents\test_0_131207679384970000.xel'. (Microsoft SQL Server, Error: 25602)
Where is the problem? I have enough permission for C:\Users\user\Documents.
You need to grant write permission to that folder to NTService\MSSQLServer, which is what the SQL Server service runs as.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With