异构查询需要为连接设置 ANSI_NULLS 和 ANSI_WARNINGS 选项.这确保了一致的查询语义 [英] Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics

查看:19
本文介绍了异构查询需要为连接设置 ANSI_NULLS 和 ANSI_WARNINGS 选项.这确保了一致的查询语义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查了整个网络,但找不到似乎对我有用的解决方案..

I have checked over the whole web and couldn't find a solution that seems to work for me..

我重新创建了我的存储过程,确保将这些行作为第一行:

I have recreated my stored procedure, making sure to have these lines as first lines:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_WARNINGS ON
GO
CREATE PROCEDURE test_insert
AS
....
BEGIN
...
END

当我从 php 调用我的存储过程时,我只会收到这个错误.它在 sql server 中工作正常..我真的不知道我还能做什么..请帮助我;_;

I only get this error when i call my stored procedure from php. it works fine in sql server.. i really don't know what else i can do..please help me ;_;

推荐答案

在你的语句之前而不是在主查询的开头添加了这个

Added this BEFORE your statement rather than at the start of the main query

$result = mssql_query("SET ANSI_NULLS ON;");
$result = mssql_query("SET ANSI_WARNINGS ON;"); 

这篇关于异构查询需要为连接设置 ANSI_NULLS 和 ANSI_WARNINGS 选项.这确保了一致的查询语义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆