Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL to reference db on SQL SERVER and TERADATA

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
Hello all,

Could someone please advice me if it is possible to have a sql query that can reference a table on SQL Server and TERADATA.

For example I am trying to create an excel userform which pulls some data from a TERADATA database and SQL SERVERDATABASE. so if [table On TERADATA] and [TABLE on SQL SERVER] have a refernce [REF] which they can be linked on I want to create an ADO connection to them and pull some data into a spreadsheet.

ie. SELECT
t.Teradatafield,
s.SQLServerField
FROM
TeradataDB t,
SQLServerDB s

Could someone please advice if something like this is possible with EXCEL VBA

I hope i have explained this well.

Cheers,
Neemi

 
Well, I have done lots of spreadsheets from ODBC data sources. So yes it is possible. But you need to consider some things.

1. How complicated is your query.
2. How many records are you going to pull.
3. The relation ship between the 2.

It might be easier to pull you data from one database to the other. Then pull the query from one.

It might also be easier to pull them into something like Access.

I you supply some more details and some data examples it might help.

Simi
 
don't think its possible to get a single query return from two different connections (to my knowledge)

you could set up two connections and loop through one referencing to the other, but as has been said above, the best would be to call a procedure that imports the data into one source (to your criteria) then simply reference from one connection!!!

i've had real issue with trying to reference oracle and sql server data within asp.... because my sql did not want to play friendly with oracle, which is how i know you can't get data from two connections into one select!!!

hope you find your way....

cheers

daveJam

even my shrink says its all your f#@/ing fault
 
Thank you both for replying.

As far as I know I may be able to do a linked server but I think I will take my original direction (also as simi has suggested) by pulling the data into access and then running the query from the access tables.

Simi, I have an idea what to do but what sort of coding examples coul you provide? any help appreciated.

cheers,
Neemi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top