Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

SQL Trace Script with Error about Parameter @stoptime

$
0
0
I have the below that I had changed to include the @filecountNumber and @stoptime parameters. I am trying to set up a trace to give me 5 files each of 1024 MB and then stop. The rest of the trace captures blocked processes and the deadlock graph, and I want to then use Michael Swartz' blocked process report viewer proc to review the results. However, I keep getting this error: Msg 214, Level 16, State 5, Procedure sp_trace_create, Line 1Procedure expects parameter '@stoptime' of type 'datetime'. How can I accomplish what I am after?-- Create a Queuedeclare @rc intdeclare @TraceID intdeclare @maxfilesize bigintdeclare @filecountnumber intdeclare @stoptime datetimeset @maxfilesize = 1024set @filecountNumber = 5set @stoptime = NULL-- Please replace the text InsertFileNameHere, with an appropriate-- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc extension-- will be appended to the filename automatically. If you are writing from-- remote server to local drive, please use UNC path and make sure server has-- write access to your network shareexec @rc = sp_trace_create @TraceID output, @options = 2, @tracefile = N'C:\SQLTraces\BlockedProcessesDeadlockGraph', @maxfilesize = @maxfilesize, @filecount = @filecountnumber, @stoptime = nullif (@rc != 0) goto error

Viewing all articles
Browse latest Browse all 6525

Trending Articles