?
Solved

Problem with my Query... Please help.

Posted on 2004-04-05
2
Medium Priority
?
475 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 1500 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

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.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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.
Suggested Courses

801 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