两台服务器数据库之间的访问.
链接服务器成功后,在查询分析器中使用查询,更新,插入都没问题,把SQL语句写成存储过程,
出现问题“错误7405,异类查询要求为连接设置ANSI_NULLS和ANSI_WARNINGS选项,这将确保一致的查询语义.请启用这些选项,然后重新发出查询.”
可是怎么设都不行.

解决方案 »

  1.   

    set ANSI_NULLS {on|off}
    对于存储过程,SQL Server 使用最初创建存储过程时的 SET ANSI_NULLS 设置值。无论随后何时执行存储过程,SET ANSI_NULLS 的设置都还原为其最初使用的值并生效。当在存储过程内唤醒调用 SET ANSI_NULLS 时,其设置不更改。在执行分布式查询时应将 SET ANSI_NULLS 设置为 ON。
     warning 原理也同上.
    所以楼主应修改在查询分析器重新生成你的存储过程(请注意全面两句不能省):
    set ansi_nulls on
    set warning on
    alter proc porcname
    as
    ...go
      

  2.   

    set ansi_nulls on
    set warning on
    alter proc porcname
    as
    ...goset ansi_nulls on
    set warning on
    create  proc porcname
    as
    ...go
    都不行,必须是ALTER proc porcname,CREATE proc porcname 第一句,加在下面,还是同样的错误.
      

  3.   

    --try
    set ansi_nulls on
    go
    set warning on
    go
    alter proc porcname
    as
    ...go
      

  4.   

    --try
    set ansi_nulls on
    go
    SET ANSI_WARNINGS ON
    go
    alter proc porcname
    as
    ...go