从PHP执行时,我无法在sql server上获取存储过程。该过程需要XML字符串并解析XML。如果我在不尝试解析过程中的XML的情况下运行下面的代码,它可以正常工作,但是当我尝试解析XML时,我收到错误。
$stmt = mssql_init('Util.prSimpleText');
$name = '<Params> <ParameterName>Name</ParameterName> <ParameterValue>Testing Name</ParameterValue> </Params>';
$returnText = 'returnText';
mssql_bind($stmt, '@Txt', $name, SQLVARCHAR, false, false);
mssql_bind($stmt, '@ReturnText', $returnText, SQLVARCHAR, true, false);
mssql_execute($stmt);
mssql_free_statement($stmt);
令我感到困惑的是,我可以直接在Navicat中运行以下查询,即使XML仍然作为字符串传递,它也能正常工作。当我运行上面的代码时PHP是否对字符串做了什么可能导致错误?
EXEC Util.prSimpleText '<Params> <ParameterName>Name</ParameterName>
<ParameterValue>Testing Name</ParameterValue> </Params>', null;
以下是我收到的错误消息:
INSERT failed because the following SET options have incorrect settings:
'CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'. Verify that SET
options are correct for use with indexed views and/or indexes on computed
columns and/or filtered indexes and/or query notifications and/or XML data
type methods and/or spatial index
operations.