我编写SQL查询并执行查询工作,但是此查询添加到PHP代码中不起作用。
$query=" SELECT k_name, count(*) from k_table left join (SELECT Split.a.value('.', 'VARCHAR(100)') AS String FROM (SELECT [k_id], CAST ('<M>' + REPLACE([k_id], ',', '</M><M>') + '</M>' AS XML) AS String FROM t_table) AS A CROSS APPLY String.nodes ('/M') AS Split(a))n on n.String=k_table.id group by k_name order by count(*) ";
$result = mssql_query($query);
$numresult = mssql_num_rows($result);
给出此错误
错误(mssql_query):SELECT失败,因为以下SET选项的设置不正确:“ ANSI_NULLS,QUOTED_IDENTIFIER,CONCAT_NULL_YIELDS_NULL,ANSI_WARNINGS,ANSI_PADDING和ARITHABORT。验证SET选项正确用于计算列上的索引视图和/或索引和/或过滤后的索引和/或查询通知和/或XML数据类型方法和/或空间索引操作。