查看 ASP 页面中执行的确切查询

发布于 2024-09-18 20:11:17 字数 439 浏览 3 评论 0原文

我的 ASP 代码中有存储过程,我想查看完整的命令文本(而不仅仅是将执行的 (?,?,?,?)),这样我就不必打开 SQL Profiler。

代码如下:

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

I've got stored procedures in my ASP code and I'd like to see the full command 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

°如果伤别离去 2024-09-25 20:11:17

设置参数后尝试读取 dbCommand.CommandText 的值。

这将为您提供将要执行的完整命令。但它不会为您提供存储过程的内容。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文