>This may seem naive, but this is the first time I have had a situation where I need to create an SQL statement that references data in 2 SQLServer databases. Using VFP to programmatically create the SQL statement and ODBC with SPT to execute the command, is it possible to SELECT data from tables in one database where the records match some criteria pulled from a second database.
>
>Example: SELECT db2.data from sometables where db2.sometables.criteria = db1.someothertables.id's.
>
>I know about normalization and realize that it would be easier to store the db1 id's in the db2 but that really won't work in this application for a number of reasons.
>
>Is this possible?
>
>Paul Montgomery
Yes, qualify the tablename with its database. ie:
select t2.field from db2..tableX t2
inner join db1..TableY t1
on t2.SomeIDField = t1.SomeRefIDField
Cetin