Solved

Problem with my Query... Please help.

Posted on 2004-04-05
2
474 Views
Last Modified: 2012-06-27
I am using the following Query in Excel VBA:

QueryBOM = "SELECT [Silver King$BOM Component].[Parent Item No_]," & _
  "[Silver King$BOM Component].[LM Version Code]," & _
  "[Silver King$BOM Component].[Point of Use]," & _
  "[Silver King$BOM Component].[Balloon No_]," & _
  "[Silver King$BOM Component].[No_]," & _
  "[Silver King$BOM Component].[Description]," & _
  "[Silver King$BOM Component].[Quantity per]," & _
  "[Silver King$BOM Component].[Unit of Measure Code]," & _
  "[Silver King$BOM Component].[Type]," & _
  "[Silver King$Item].[No_]," & _
  "[Silver King$Item].[LM Current BOM Version]," & _
  "[Silver King$Item].[LM Item Status]," & _
  "[Silver King$Item].[Description]," & _
  "[Silver King$Item].[Revision Level]," & _
  "[Silver King$Item].[Replenishment System]," & _
  "[Silver King$Item].[Base Unit of Measure]" & _
  "FROM [Silver King$BOM Component],[Silver King$Item] " & _
  "WHERE [Silver King$BOM Component].[No_] = '" & PartNumberChild & "' " & _
  "AND [Silver King$BOM Component].[LM Version Code] = " & _
  "[Silver King$Item].[LM Current BOM Version] " & _
  "ORDER BY [Silver King$BOM Component].[Parent Item No_]," & _
  "[Silver King$BOM Component].[LM Version Code]," & _
  "[Silver King$BOM Component].[Point of Use]," & _
  "[Silver King$BOM Component].[Balloon No_]"

But I guess this error about it runs for about a minute:

Run-time error '-2147467259 (80004005)':
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (WrapperRead()).

In the past I queried one table at a time and then skipped past the data I didn't want, but in an attempt to reduce run-time I wanted to try a join (or adding a compare between fields in each table in the WHERE command).

Any help would be great!

Thanks
0
Comment
Question by:dougshepard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 500 total points
ID: 10762349
To make things easier, I would paste the query into Query Analyzer and take a look at it.    See what the query plan looks like and see if Query Analyzer gives any errors.
0
 

Author Comment

by:dougshepard
ID: 10770828
Ahhh.  Query Analyzer is part of Enterprise Manager.  Thanks.  

I think I was running out of memory (i.e. bringing in too large of a recordset because of query was incorrect).

Thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

696 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