Bagikan melalui


Profiler Utility

The profiler utility launches the SQL Server Profiler tool. The optional arguments listed later in this topic allow you to control how the application starts.

Note

The profiler utility is not intended for scripting traces. For more information, see Introducing SQL Server Profiler.

Syntax


profiler
    [ /? ] |
[
{
{ /U login_id [ /P password ] }
| /E
}
{[ /S sql_server_name ] | [ /A analysis_services_server_name ] }
[ /D database ]
[ /T "template_name" ]
[ /B { "trace_table_name" } ]
{ [/F "filename" ] | [ /O "filename" ] }
[ /L locale_ID ]
[ /M "MM-DD-YY hh:mm:ss" ]
[ /R ]
[ /Z file_size ]
]

Arguments

  • /?
    Displays the syntax summary of profiler arguments.

  • /Ulogin_id
    Is the user login ID for SQL Server Authentication. Login IDs are case sensitive.

    Note

    When possible, use Windows Authentication..

  • /Ppassword
    Specifies a user-specified password for SQL Server Authentication.

  • /E
    Specifies connecting with Windows Authentication with the current user's credentials.

  • /S sql_server_name
    Specifies an instance of SQL Server. Profiler will automatically connect to the specified server using the authentication information specified in the /U and /P switches or the /E switch. To connect to a named instance of SQL Server, use /S sql_server_name\instance_name.

  • /A analysis_services_server_name
    Specifies an instance of Analysis Services. Profiler will automatically connect to the specified server using the authentication information specified in the /U and /P switches or the /E switch. To connect to a named instance of SQL Server use /A analysis_services_server_name\instance_name.

  • /Ddatabase
    Specifies the name of the database to be used with the connection. This option will select the default database for the specified user if no database is specified.

  • /B "trace_table_name"
    Specifies a trace table to load when the profiler is launched. You must specify the database, the user or schema, and the table.

  • /T"template_name"
    Specifies the template that will be loaded to configure the trace. The template name must be in quotes. The template name must be in either the system template directory or the user template directory. If two templates with the same name exist in both directories, the template from the system directory will be loaded. If no template with the specified name exists, the standard template will be loaded. Note that the file extension for the template (.tdf) should not be specified as part of the template_name. For example:

    /T "standard"
    
  • /F"filename"
    Specifies the path and filename of a trace file to load when profiler is launched. The entire path and filename must be in quotes. This option cannot be used with /O.

  • /O **"**filename "
    Specifies the path and filename of a file to which trace results should be written. The entire path and filename must be in quotes. This option cannot be used with /F.

  • /Llocale_ID
    Not available.

  • /M "MM-DD-YY hh:mm:ss"
    Specifies the date and time for the trace to stop. The stop time must be in quotes. Specify the stop time according to the parameters in the table below:

    Parameter

    Definition

    MM

    Two-digit month

    DD

    Two-digit day

    YY

    Two-digit year

    hh

    Two-digit hour on a 24-hour clock

    mm

    Two-digit minute

    ss

    Two-digit second

    Note

    The "MM-DD-YY hh:mm:ss" format can only be used if the Use regional settings to display date and time values option is enabled in SQL Server Profiler. If this option is not enabled, you must use the "YYYY-MM-DD hh:mm:ss" date and time format.

  • /R
    Enables trace file rollover.

  • /Z file_size
    Specifies the size of the trace file in megabytes (MB). The default size is 5 MB. If rollover is enabled, all rollover files will be limited to the value specified in this argument.

Remarks

To start a trace with a specific template, use the /S and /T options together. For example, to start a trace using the Standard template on MyServer\MyInstance, enter the following at the command prompt:

profiler /S MyServer\MyInstance /T "Standard"

See Also

Concepts