Solved

What's the syntax for querying a linked server in sql 2005 sp3?

Posted on 2011-03-08
7
225 Views
Last Modified: 2012-05-11
I have setup a linked server to a mysql successfully.  But I need to know what's the
syntax like select, update...  Thanks.
0
Comment
Question by:lapucca
7 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 35075993
IIRC, it should be:

    select * from [server name].[database name].[database owner].[table name]
0
 

Author Comment

by:lapucca
ID: 35076036
[server name] is the linked server name?  how do I find out what's the database owner name?  Would that be my mysql remote user id?
0
 
LVL 15

Accepted Solution

by:
derekkromm earned 400 total points
ID: 35076041
http://msdn.microsoft.com/en-us/library/ms188427(v=sql.90).aspx

select * from openquery(<yourlinkedservername>, 'select * from <yourtables>')
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 35076672
Correction to kaufmed:

select * from [server name].[database name].[schema name].[table name]


[schema name] not [database owner]
ie. dbo
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 35076849
@BrandonGalderisi

Thanks. It's been years since I've actually done it    = )
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
ID: 35082862
in mysql, there is no "database" name in that 4-part-name syntax.
what mysql names as databases, are translated into schemas.

however, as I only had problems with the 4-part-name syntax for mysql, I exclusively used the openquery method.
0
 

Author Closing Comment

by:lapucca
ID: 35086803
Thanks.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question