开发者

View exact query executed in ASP page

开发者 https://www.devze.com 2023-01-16 00:19 出处:网络
I\'ve got stored procedures in my ASP code and I\'d like to see the full command开发者_Python百科 text (not just the (?,?,?,?) that will execute so I don\'t have to open up SQL Profiler.

I've got stored procedures in my ASP code and I'd like to see the full command开发者_Python百科 text (not just the (?,?,?,?) that will execute so I don't have to open up SQL Profiler.

Code is as follows:

sSQL="myProc"   
Set dbCommand = Server.CreateObject("ADODB.Command")    
Set dbCommand.ActiveConnection = oConn  
dbCommand.CommandType = adCmdStoredProc 
dbCommand.Commandtext=sSQL  
dbCommand.Parameters.Append (dbCommand.CreateParameter("@tutorID", adInteger, adParamInput, 0, sTutorID))   
set oRST=dbCommand.Execute


Try reading the value of dbCommand.CommandText after you set the parameter.

This should give you the full command that will be executed. It won't give you the content of the stored procedure, though.

0

精彩评论

暂无评论...
验证码 换一张
取 消