I'm having trouble getting a stored procedure on sql server to work when executed from PHP. The procedure expects an XML string and parses the XML. If I run the code below without trying to parse the XML in the procedure, it works fine, but when I try to parse the XML, I get an error.
$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);
The thing that is baffling me is that I can run the following query directly in Navicat and it works fine even though the XML is still being passed as a string. Is PHP doing something to the string when I run the code above that could cause an error?
EXEC Util.prSimpleText '<Params> <ParameterName>Name</ParameterName>
<ParameterValue>Testing Name</ParameterValue> </Params>', null;
Here is the error message I'm getting:
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.