Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to connect to an MSSQL Server group with PHP and action a select query over a view . I can connect & pull results from the server . I can connect & pull results from a DB

With MSSQL under registered servers (top left) you can create a new server group and add existing databases as a server registration this allows for a single query to be run over multiple databases. I cant find any information on how to connect to this from PHP.

FYI:-Setting Server Group: http://www.youtube.com/watch?v=bTz3OZKTdMg

I have also tried creating a view in each database then in one database creating a view that joins each of the views together it works in management studio but i get an error form PHP "Undefined Index"

I.e db1:

Create View ffa

db2:

Create view ffa

:dblook

create view ffa as select * From db1.ffa union all select * From db2.ffa

Then php to look at dblook.ffa I get a connection but "Undefined Index" error?

I have both SQL and Express currently testing on Express I would prefer the connecting to server group option (seems a lot faster in management studio) But happy to try any other solution

Thanks.

share|improve this question
Where is your tried code?? – Yogesh Suthar Apr 4 at 5:24
in the middle it was meant to be three little examples i.e. db1:, db2: and dblook it looks horrible sorry, i'll try and fix it up again – benaw Apr 4 at 5:28
1  
Could you share the PHP code you are using behind this? Normally a view just returns a result just like a table. The undefined index is mostlikely just you misspelling a case-senstive columnname – Hugo Delsing Jun 4 at 13:56
It looks like there is a requirement for the indexes on all tables to be the same. Are they exactly the same? – Stoleg Jun 7 at 9:42

This question has an open bounty worth +50 reputation from ADC ending in 23 hours.

This question has not received enough attention.

I have the same problem over a SSIS dts development.

1 Answer

The server group is just a logical way to group Servers in the GUI. It's not a function of the SQL Server database engine.

What you are referring to is partitioned views which falls under the concept of Federated Database Servers.

Basically, using Linked Servers, you create views on each database servers that union multiple servers together. A load balancer can then point to any database server. This only happens on the read requests as other CRUD operations require some type of routing.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.