Printed 2017/08/17 08:08AM

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

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-2017 Redgate. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.