|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-03-11 15:24 UTC] raulionescu at gmail dot com
Description: ------------ I have created a stored procedure wich is accessing an remote linked MSSQL 2000 server and works perfectly from Querry Analyzer. The problem occurs when I try to execute the stored procedure from php (by using mssql_bind or mssql_query); I've got no error but no result either. It seems that php doesn't allows to access remote linked servers! PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
I'm experiencing the same error, Warning: mssql_query() [function.mssql-query]: message: Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query, when attempting to execute a linked MDX query to SQL Server Analysis Services (an analytics cube). Below is the query .... set ANSI_NULLS ON; set ANSI_ARNINGS ON; exec sp_addlinkedserver @server='linked_olap', @srvproduct='', @provider='MSOLAP.3', @datasrc='scout', @catalog='Adventure Works DW Standard Edition' ; SELECT * FROM OpenQuery(linked_olap,'SELECT {Measures.[Internet Order Count]} ON COLUMNS , [Product].[Category].members ON ROWS FROM [Adventure Works]') ; exec sp_dropserver 'linked_olap' ; ------------ In the linked server procedure, 'scout' is my database server name, but Adventure Works is the sample analysis server data warehouse (cube), so you should be able to recreate this simply. Are there any plans to support native MDX queries against a SQL Server Analysis Server, or plans to resolve this issue?try adding this right before you call your mssql_query $result = mssql_query("SET ANSI_NULLS ON") or die(mssql_get_last_message()); $result = mssql_query("SET ANSI_WARNINGS ON") or die(mssql_get_last_message());@ericsolan Thank you thank you thank you. Your fix... $result = mssql_query("SET ANSI_NULLS ON") or die(mssql_get_last_message()); $result = mssql_query("SET ANSI_WARNINGS ON") or die(mssql_get_last_message()); ... worked *perfectly* on CentOS release 5.2 (Final) connecting to Microsoft SQL Server 9.0.3042.I used the following and it worked $result = mssql_query("SET ANSI_NULLS ON") or die(mssql_get_last_message()); $result = mssql_query("SET ANSI_WARNINGS ON") or die(mssql_get_last_message()); $sql_str = "SELECT * FROM OPENQUERY(TEST, 'SELECT I_DESCRIPTION FROM INVFULL')" ;