How can I track sql scripts executed against with SA login SQL server?

Lakshmi kiran Vennapusa 1 Reputation point
2021-01-05T06:23:01.2+00:00

How can I track sql scripts executed against with SA login SQL server? currently we are using extended events to track these, do we have any alternative methods?

Developer technologies Transact-SQL
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JoyDutt 831 Reputation points
    2021-01-05T06:51:54.733+00:00

    Hi @Lakshmi kiran Vennapusa

    Currently no direct way as such to track sql Scripts executed against any login.
    Let me explore some option if from SSMS.

    (Please don’t forget to "Accept the answer" & “up-vote” , this can be beneficial to other members. Thank You)

    Regards,
    J.D.


  2. MelissaMa-MSFT 24,221 Reputation points
    2021-01-05T07:39:08.36+00:00

    Hi @Lakshmi kiran Vennapusa ,

    Thank you so much for posting here in Microsoft Q&A.

    Please have a try with below methods and hope any of them could be helpful to you.

    1. SQL Server Profiler
    2. Create a trigger
    3. SQL Server Audit (Database Engine)
    4. User_defined Procedure

    Best regards
    Melissa


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.