>I have been through the files here, on the microsoft site and even bought a SQL book to get me going, but no one seems to directly address my situation:
>On this job I have multiple servers that contain SQL databases. One project I'm working on now requires me to get a join from 2 tables from 2 different databases. One database table contains the info I need and a SS#. The other database contains the name and address info to go with the SS#. It seems that the best idea would be to keep those tables together, but that is not an option for me.
>When I send this command:
>SQLPREPARE(myhandle,"SELECT * from courses","TEMPCOURSES")
>the handle puts me directly into one database, so I'm not sure how I can address a table in another database for the join.
>I tried using the query builder wizard, remote view wizard and MS Query to see how they would handle the situation and they don't seem to go far enough to do this kind of work. The help file for MS SQL Server 6.5 intimates that it is possible, but doesn't say how to do it. I'm running this from a web page, Foxweb, VFP 5.0 and MS SQL server.
>TIA
You should provide full reference to table which is not in current database:
Select * From Databasename.dbo.Tablename
Edward Pikman
Independent Consultant