http://www.sqlservercentral.com/blogs/jeffrey_yao/2007/11/14/generate-rpccompleted-event/ Printed 2015/08/29 11:00AM
Generate RPC:Completed EventI 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
Save this as a RPC.vbs file, and in command window, I just run
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
and in SQL Profiler, I can see the RPC:Completed event