You are here: Converting Traceid issue « MsSQL Server « IT news, forums, messages
Converting Traceid issue

Posted by michael via SQLMonster.com on 02/28/06 22:41

Hi,

I am trying to automate a SQL Trace via a stored procedure and a job. The job
executes the stored procedure to start the trace and every 15 minutes, the
job is supposed to stop the trace, clear it from memory, rename the trace
file, and start a new trace so I can select the average duration for this
process. I am getting the following error message:

Procedure expects parameter '@traceid' of type 'int'

When I try to run this portion of the script (@traceid is declared as an INT
at the beginning of the job):

Set @traceid = (select distinct(convert(int,traceid)) from ::fn_trace_getinfo
(default) where value = 'D:\MSSQL\JOBS\HCMDB_RequestQueue_Trace.trc') -- the
name of my trace file

print 'Stop current trace'
exec sp_trace_setstatus @traceid,0

print 'Erase current trace from memory'
exec sp_trace_setstatus @traceid,2

print 'Moving file to _1'
exec master..xp_cmdshell 'move D:\MSSQL\JOBS\HCMDB RequestQueue Trace.trc D:\
MSSQL\JOBS\HCMDB_RequestQueue_Trace1.trc',
NO_OUTPUT

I know I must be missing something obvious, but I haven't been able to figure
it out. Any assistance is greatly appreciated.

Thanks,
Michael

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-general/200602/1

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация