日期:2014-05-17  浏览次数:20527 次

(急)linux php使用mssql_query()函数,sql中出现分布式跨库查询,出错
使用sqlserver2008, linux php通过freetds使用sqlserver.
现在sql:
Select Top 10 A.*
From A Left Join A1 B On A.UserID = B.UserID                          
Left Join  [192.168.12.5].[web1DB].publ.tablename C On A.UserID = C.user_id
Order By A.diplayOrder;


出在提示

Warning: mssql_query() [function.mssql-query]: message: Could not find server '192.168.12.5' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers. (severity 11)


如果说是sqlserver配置问题的话,另一台的asp代码中是能使用的,请问,freetds不支持跨库吗?请那位大虾指点一下,或是让我死心。再次鄙视微软。下次找工作,使用window
、sqlserver的不考虑。

------解决方案--------------------
鄙视微软

用sql server工具连接sql server执行以上语句看看是否报错

你的[192.168.12.5].[web1DB].publ.tablename 是个链接服务器的表,从提示看没有找到链接服务器[192.168.12.5],如果用sql server工具连接sql server执行以上语句能成功我帮你鄙视微软100次,如果不能执行成功只能说明你用法不对了,帮你鄙视微软1次
------解决方案--------------------
自己的产品兼容也这么差! 微软 +1