We help IT Professionals succeed at work.

Create a sql trace for a stored procedure

tupac1979
tupac1979 asked
on
I have stored procedure that runs as a job and it has started failing giving me an error of "String or binary data would be truncated. [SQL STATE 22001] [Error 8152] The statement has been terminated [SQLSTATE 01000] [Error 3621]. The step failed. I am trying to run a trace on the stored procedure because when I execute the sp in query analyzer it works fine. When I run a trace I do not get any results I would appreciate any help on setting me up a trace to troubleshoot this error. Thanks
Comment
Watch Question

David ToddSenior Database Administrator
CERTIFIED EXPERT

Commented:
Hi,

What template for the trace are you using? What version of SQL?

Cheers
  David

Author

Commented:
Thanks I dont have a template I have been trying to run the trace by object ID or so forth but apparently I am using the wrong object ID. Also I am using sql server 2000 enterprise edition. Thanks
David ToddSenior Database Administrator
CERTIFIED EXPERT

Commented:
Hi,

In Profiler, when you create a trace, the first text box has Trace Name, below that is a selection for which server. In the next division is the combo box titled Template Name.

Which Templage are you using?

Cheers
  David

Author

Commented:
I was using a blank template name and just using filter on the object id of the sp but that doesnt seem to work.
David ToddSenior Database Administrator
CERTIFIED EXPERT

Commented:
Hi,

Try the "SQL Profiler TSQL_SPs" template.

Cheers
  David

Author

Commented:
Thanks dtodd,
I have tried that it gives a bunch of information about all of the stored procedures since I have 10 databases how do I focus on the one database. Thanks
Senior Database Administrator
CERTIFIED EXPERT
Commented:
Hi,

On the filters table, expand DatabaseName, expand like, and enter the name of the database.

HTH
  David

Explore More ContentExplore courses, solutions, and other research materials related to this topic.