Solved

query a joined local table with a linked dbo.sql.table

Posted on 2013-01-27
13
368 Views
Last Modified: 2013-03-19
I have an Access 2010 accdb file which contain a local table.
I have also link this accdb file with a table resident in a SQL server, by using ODBC connection.
I have built sub-queries from a queries based on the local table with a dbo.table located on a server in the SQL.
Whenever running the sub-queries based on the queries as i mentioned , Access takes a long time to process the result.
I have heard that in order to speed up the result of the query I need to build a PASS-THROUGH query.
My problem is that I can`t connect or build any table in the sql server.
I must have local-table in the accdb + linked table from SQL i having both joined to manipulate data from both by using queries.
All queries built up, I did by using a DESIGN VIEW in Access 2010 . Without any VBA code of the DAO or ADO or PASS-THROUGH or SQL VIEW.
Please help, I think it's an interesting challenge:}}
0
Comment
Question by:drtopserv
  • 6
  • 3
  • 2
  • +1
13 Comments
 
LVL 26

Expert Comment

by:jerryb30
ID: 38824842
Will you be trying to update/edit the linked SQL table?

If not: What I have done is to make a (temp) table in the Access DB using the minimal fields/records from the linked table. No guarantee the make-table query will be quick, but subsequent queries ought to be quicker.
0
 
LVL 42

Expert Comment

by:EugeneZ
ID: 38825117
<problem is that I can`t connect or build any table in the sql server.>

as temp solution , as per above post use stage table in access
as per solution find your DBA and ask to assist you on sql server site

for speed - you may need to set there indexes (sql server) , maybe even use stored procedures
0
 
LVL 16

Accepted Solution

by:
kmslogic earned 500 total points
ID: 38825239
It's difficult to see where the problem from just a description.  The actual SQL from the queries would be useful as well as some information about the # of records, structure and indexes of the tables involved.

I think the suggestion to make a temp file is certainly a possibility.  

This may be a pipeline issue where you're causing the SQL server to dump essentially the entire table over your network pipe in order to do its queries--so you may want to see if there's some tweaking you can do to reduce the data coming over the wire to the bare minimum.  

Also using a snapshot query type for the sub queries (which will make the resulting query read-only) may help things.

Lastly you'll want to make sure you have appropriate indexes on both your local tables and the linked tables on SQL server you're using in your query.  If you see a column in the where clause there's a pretty good chance you'll want an index on that column.
0
 

Author Comment

by:drtopserv
ID: 38825482
thanks all for the answer, but still can`t get solution from it.
there is no update in the queries, i`m talking about only manipulate data.
I do not have the ability to do any creation or access to sql server for many reasons.
production server that i shouldn`t touch from my side . i have hardly access the view tables in there to do the query, my local table data i have is from importing xls file to it every day. and i need to do query to the remote sql server table to get some fields and row from there.
0
 

Author Comment

by:drtopserv
ID: 38825484
doesn`t pass-through query help me out, may i use pass-through query to link local table with the sql remote table, is it possible, if yes then how can i do it .
does using vba code will help more than using the design view...?\
i hope that i can found suitable solution :}
0
 
LVL 16

Expert Comment

by:kmslogic
ID: 38825493
No you can't use pass through to create a linked table.  You can create a separate pass through query to access the SQL table directly without a linked table. however I cannot think of a situation where this would make your queries run faster.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:drtopserv
ID: 38825527
I think there  must be solution around :{{{{
need to seek , thanks for your answer anyway:}
0
 
LVL 42

Expert Comment

by:EugeneZ
ID: 38825547
< i need to do query to the remote sql server table to get some fields and row from there. >
yes, you  need to do query to the remote sql server table to get some fields and row from there.

work with your DBAs team to have it
and for now staging table needs to be considered
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38825559
Drtopserv,
We have offered some solutions to possibly make your queries work faster.
a. Do a make-table query off of your linked table,
as in 'Select * into tempTable from yourLinkedTable'.
b. Better still, if table size is an issue:
'Select field1, field2, field4, etc into tempTable from yourLinkedTable'

c. or better, if there are criteria:

'Select field1, field2, field4, etc into tempTable from yourLinkedTable
where somefield = LocalTable.fieldInLocalTable'

tempTable being a staging table as mentioned by EugeneZ
0
 

Author Comment

by:drtopserv
ID: 38825567
Ok, the linked table you mean is the local table or the sql one.
if you are talking about the table resident in sql , then it`s not a good solution.
it`s very big table! .
0
 

Author Comment

by:drtopserv
ID: 38825569
Oh sorry i can see you mean the sql-server-table as linked table :{
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38825576
Yes.
 kmslogic (ID: 38825239) stated good points which were missing from simple suggestions.

Especially: Size of linked table, interms of record count, table structure
SQL, meaning specific fields needed from linked table
Tweaking to reduce amount of data needing to go to access
0
 

Author Closing Comment

by:drtopserv
ID: 38998270
thnx i`ll go for your suggestion
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE sā€¦

746 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

12 Experts available now in Live!

Get 1:1 Help Now