http://www.sqlservercentral.com/blogs/jeffrey_yao/2007/11/14/generate-rpccompleted-event/

Printed 2014/11/23 06:39AM

Generate RPC:Completed Event

By Jeffrey Yao, 2007/11/14

I was doing a research on SQL trace regarding RPC:Completed event. So I need to generate a RPC:Completed event first for test, but it seems I cannot(or I do not know how to) do it within SSMS quickly.

So I create a quick VBScript to do this for me:

dim oCnn, oCmd
set oCnn = createobject("ADODB.Connection")
set oCmd = CreateObject("ADOdb.Command")
oCnn.Open "Provider='sqloledb';Data Source='myServer'; Integrated Security='SSPI';Initial Catalog='TestDB';"
oCmd.ActiveConnection = oCnn
oCmd.CommandText = "sp_who"
oCmd.CommandType = 4 'adCmdStoredProc
oCmd.execute

Save this as a RPC.vbs file, and in command window, I just run

cscript RPC.vbs

and in SQL Profiler, I can see the RPC:Completed event
Copyright © 2002-2014 Simple Talk Publishing. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.