Solved

Linked Server: Using Four Part Syntax

Posted on 2006-06-26
8
373 Views
Last Modified: 2010-05-18
I have tried the "Four Part Syntax" and it fails.
However, the standard "openquery" technique works great.

For example, as displayed in this article:
http://www.aspfree.com/c/a/Microsoft-Access/Configuring-a-Linked-Microsoft-Access-Server-on-SQL-2005-Server/4/

select * from openquery(AccessDB, 'select * from employees')  '<< works fine (openquery method)

select * from AccessDB...Employees '<< fails (4 part syntax method)

Is this typed correctly?

Thanks.



0
Comment
Question by:born4code
8 Comments
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16989063
select * from [AccessDB].DatabaseName.DBO.Employees

I am assuming that AccessDB is your linked server?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16989917
Both should work, but I always prefer the OpenQuery method as it is more flexible to solve a certain amount of problems.
now, when you say it fails, what is the error message?
0
 
LVL 2

Author Comment

by:born4code
ID: 17075854
Sorry it took so long for me to get back.  I was on vacation.

Okay... the AccessDB is the name of the linked server.
Let me go and check the error message.
0
 
LVL 2

Author Comment

by:born4code
ID: 17085711

Statement was: select * from AccessDB...select * from myTable
Also tried: select * from AccessDB.MainDatabase.dbo.myTable

Error Code is:

OLE DB provider "SQLNCLI" for linked server "AccessDB" returned message "Unspecified error".
OLE DB provider "SQLNCLI" for linked server "AccessDB" returned message "The stored procedure required to complete this operation could not be found on the server. Please contact your system administrator.".
Msg 7311, Level 16, State 2, Line 3
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI" for linked server "AccessDB". The provider supports the interface, but returns a failure code when it is used.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 2

Author Comment

by:born4code
ID: 17334061
Obviously there are no solutions provided in this thread that work.
Please close.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 17374316
>>Please close.<<
This is how it works here (from the EE Help):

Nobody answered my question. What do I do?
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi71
0
 
LVL 2

Author Comment

by:born4code
ID: 17381092
Interesting... and definitely some more work to do.

Before you ask the Moderators to help you in this circumstance, take the time to post a message in your question stating your intention to have the question deleted or closed, and make sure you have responded to all of the Experts' comments. Then post a question in the Community Support topic area asking the Moderators to delete your question. Remember to post a link to the original question in your request. If there are no comments in the question, one of the Moderators will delete the question. If there are comments, the Moderator will post notice of your request, and will give the participants 96 hours to object. You may be required to post your reason for asking for the deletion, and objections will be taken into account.

I learned more from this than the question results.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17381899
While I appreciate the points, they are not meritted, please see here (also from the EE Help):

I accepted the wrong answer. Now what?
http://www.experts-exchange.com/help.jsp#hi17
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now