How do you change the default username for default SQL Trace

Posted on 2009-12-23
Last Modified: 2012-05-08
I noticed in the sql logs that in this entry -

SQL trace ID 1 was started by login "sa"

How do I change the user or login for the default sql trace getting automatically started?
Meaning, I don't want the instance using the user = 'sa' to login, etc.

Question by:sahkeah
    LVL 57

    Accepted Solution

    Default SQL Trace is enabled in SQL Server by default to capture many useful information listed below:

    To capture all this information, it should / would ideally use the sa privileges and hence it is configured to run using sa credentials.

    We have the option to either disable it but not change the default user for it.

    Steps to disable the trace( Not recommended):

    sp_configure 'default trace enabled' , 0
    LVL 5

    Expert Comment


    I agrred with the rrjegan17 cooment. It is right that you can off trace but can not change the login.

    Default Trace in SQL Server 2005
    When i saw *SQL Trace ID 1 was started by login "sa" * in my Error Log I was little surprised. Since i have never started any trace I was wondering what is this all about. Then i came to know that this is the default trace started which is a new feature introduced in SQL Server 2005. Then i was curious about how can i see the contents. here we go...

    To See All the Trace and its location :
    select * from ::fn_trace_getinfo(default)

    To get the File Location
    select * from ::fn_trace_getinfo(default) where Property=2

    And copy paste the Value column text.

    To Get the Trace Data

    SELECT * FROM fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log.trc', default) where starttime>'2009-12-26'

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now