Please turn on javascript in your browser to play chess.
Developers Forum

Developers Forum

  1. 23 May '05 13:16
    Anyone know if you can create a view over multiple SQL Servers??

    May I ask how?
  2. Standard member Chakan
    Oro!
    23 May '05 13:26
    Are you using Mysql or MS SQL 2000?
  3. Standard member Chakan
    Oro!
    23 May '05 14:09
    http://www.sourcekeg.co.uk/www.mysql.com/doc/mysql/en/create-view.html

    thats a mysql view create statement, near the topish it explains views on mutliple databases not sure on multiple servers, but figure they must have coded this in 5.0.1

    anyway hope that helps, if not sorry.

    Chakan
  4. 23 May '05 14:35
    Originally posted by Black Lung
    Anyone know if you can create a view over multiple SQL Servers??

    May I ask how?
    If you are using MS SQL 2000

    The short answer: Yes you can

    The longer answer:
    You will need to add all the other servers (the ones the calls are not originating from) using the stored proc: sp_addlinkedserver

    Then you can reference them using something like:

    SELECT * from ServerName.DatabaseName..TableName
    *note the 2 dots before tablename, you can put the table owner name in between those, but it is not usually necessary.

    Play around with it for joins, if you run into "mysterious" problems of it not selecting correctly, I suggest looking into specifying the COLLATION used when making the join.

    If this all confuses you, some google searches of terms listed above could help.

    --tmetzler
  5. 24 May '05 12:00
    SQL Server 2000

    Thanks T, I'll try that