dongshendie8849 2015-07-23 16:05
浏览 49

如何从SQL Server 2012上的PHP准备语句中查看绑定变量?

I have read the SO question about Oracle's Bind equivalent. This is four years later, however. I have looked at sp_executesql from

https://msdn.microsoft.com/en-us/library/ms188001.aspx?f=255&MSPPError=-2147217396

I am not using T-SQL or any sort of Stored Procedure, only a PHP Prepared Statement (using PDO).

How can I view my bound value in SQL Server 2012? If there is a way for me to use sp_executesql, I do not know how to use it.

EDIT: When I say view, I mean a table in SQL Server.

EDIT: I am trying to find out the value that was received by SQL Server. I want to query a view, table, run a stored procedure, something so I can see what SQL Server actually received.

Here is a similar question: What is the SQL Server equivalent of Oracle bind variables in dynamic SQL?

This is what it is in Oracle 11g:

http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2114.htm#REFRN30310

"V$SQL_BIND_CAPTURE displays information on bind variables used by SQL cursors. Each row in the view contains information for one bind variable defined in a cursor. This includes:"

EDIT: Example,

$sql = "SELECT * FROM employees where employeeid = :mykey";
$prepared_statement = $this->_adapter->prepare($sql);
$prepared_statement->bindValue(':mykey', $_employee_search, PDO::PARAM_INT);
$prepared_statement->execute();

I wan to know :mkey after it has been sent to SQL Server.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
    • ¥15 C# datagridview 单元格显示进度及值
    • ¥15 thinkphp6配合social login单点登录问题
    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 虚心请教几个问题,小生先有礼了
    • ¥30 截图中的mathematics程序转换成matlab