Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select with the second DB
Message
De
29/01/2022 17:41:55
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01683370
Message ID:
01683372
Vues:
61
As a general statement, use an ALIAS after the "from".
I'm not 100% positive if you're using SQL Passthrough from VFP, but as a general statement, I can do this in SQL server

USE ProductionDB
GO

SELECT ProdTable.Name as ProductionName, TestTable.Name as TestName
FROM ProductionTable ProdTable
JOIN TestDB.TestingTable TestTable
WHERE ProdTable.SomeKey = TestTable.SomeKey

Once you have the ALIAS, you shouldn't need to have to reference the 2nd database every time (again, to best of my awareness, but I haven't done anything from VFP->SQL in a long time, so you might want to test to be sure)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform