|
-
May 4th, 2005, 03:46 AM
#1
Thread Starter
Hyperactive Member
Informix and SQLServer [resolved]
Guys
Is it possible to directly query an informix database from SQLServer, ie from Query Analyser or Enterprise Manager?
Cheers
Peter
Last edited by thebloke; May 4th, 2005 at 05:03 AM.
Reason: resolved
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
May 4th, 2005, 04:21 AM
#2
Frenzied Member
Re: Informix and SQLServer
I don't see why not.
If you have an OLEDB Driver for Informix on the SQLServer box, then you should be able to create a linked server and query it.
Or you could investigate the OPENROWSET T-SQL function.
-
May 4th, 2005, 04:40 AM
#3
Thread Starter
Hyperactive Member
Re: Informix and SQLServer
Linked server. Right. Ok, how do I do this. I have a system dsn set up.....
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
May 4th, 2005, 04:55 AM
#4
Frenzied Member
Re: Informix and SQLServer
Hmmm. Not sure how/if you can use your DSN, but Linked Servers can be set up in a similar way.
In Enterprise Manager drill down to the Security node (something like SQL Server Group > local > Security > Linked Servers) and it has a nice little wizard (not very intuitive, but it gets you there).
You can also use a range of system stored procedures, for example sp_addlinkedserver.
-
May 4th, 2005, 04:57 AM
#5
Thread Starter
Hyperactive Member
Re: Informix and SQLServer
Yeah, I found the wizard but I'm a bit foxed with some of the fields. Sorry to sound like such a dunce!
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
May 4th, 2005, 05:02 AM
#6
Thread Starter
Hyperactive Member
Re: Informix and SQLServer
Oh! It's ok! I just put in the name of the DSN and Bob's your uncle, as it were.
Thanks! You pointed me in the right direction!
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
May 4th, 2005, 05:14 AM
#7
Frenzied Member
Re: Informix and SQLServer [resolved]
Cool. Glad it worked.
While you were trying that I found this on books online, which is for DB2, but it should be possible to bend it to do Informix if you wish...
-
May 4th, 2005, 05:34 AM
#8
Thread Starter
Hyperactive Member
Re: Informix and SQLServer [resolved]
Thanks Pete
I can now see the tables but can't query them! I've tried
SELECT *
FROM OPENQUERY(mylinkedserver, 'SELECT * FROM mydatabase.mytable.myfield')
but it aint working. I get this error:
Code:
Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution against OLE DB provider 'MSDASQL'.
[OLE/DB provider returned message: [Esker][liv-electra:TUNODBC200.ifx][electra] Syntax error or access violation]
OLE DB error trace [OLE/DB Provider 'MSDASQL' ICommandPrepare::Prepare returned 0x80040e14].
I think possibly the problem may be that I don't know what the database name is! I see the linked server name and the tables and views so I've used the same name for the linked server and the database. This is probably wrong!
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
-
May 4th, 2005, 05:40 AM
#9
Thread Starter
Hyperactive Member
Re: Informix and SQLServer [resolved]
No, really. I've sorted it this time!
Thanks again!
The Bloke
www.blokeinthekitchen.com
making cooking cool for blokes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|