question

BGSisson avatar image
BGSisson asked

Tokenize stored procedure values supplied in calls?

I'm looking for a utility that will tokenize parameter values in stored procedure calls captured through extended events or profiler. I want to get a unique list of all the parameters supplied to a stored procedure, ignoring their values. For instance, the stored procedure calls: members_search @home_phone='1234567890',@first_nme='bob',@last_nme='smith' members_search @home_phone='987654321',@first_nme='jim',@last_nme='jones' Would both be tokenized as : members_search @home_phone=#,@first_nme=#,@last_nme=# This way I can tell that the stored procedure is called with values for those three parameters without caring what those values were. I remember running across a routine many years ago that did it, but I can't find it now. As a separate question, since I can't find the routine, does that mean I can find what I want somewhere within SQL native functionality, or does nobody but me want to do this?
parametersstored procedures
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Grant Fritchey avatar image
Grant Fritchey answered
It's not clear how you're capturing the calls to your procedures, but if you use extended events, you can get the object_id values for the procedures. This will allow you to group the calls to those procedures by the object_id rather than relying just on the text of the call itself. Then you don't need to clean the text in this manner. The procedure you're looking for was written by Itzik Ben Gan for SQL Server 2000 to deal with trace events output. With extended events and the object_id, there just isn't a need for it unless you're still working with SQL Server 2000 or 2005.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.