473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Join Sql Table and Excel Sheet

112 100+
Hi,
I am trying to link sql table field and excel sheet column.

SELECT wko_itemid, imc_qty, ima_price
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Documents and Settings\mohammed\Desktop\wkotesting.xls;IMEX=1',
'SELECT * FROM [sheet2$]') inner join dbo.imc on
dbo.imc.imc_itemid= Sheet2.wko_itemid inner join dbo.ima on
dbo.ima.ima_itemid =dbo.imc.imc_itemid

But i am getting error message "The column prefix 'Sheet2' does not match with a table name or alias name used in the query".

Please Help me to link sql table field and excel sheet column.

Thanks
Aug 1 '07 #1
3 9620
imtmub
112 100+
Still i didn't get any slution. Please help me out

Hi,
I am trying to link sql table field and excel sheet column.

SELECT wko_itemid, imc_qty, ima_price
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Documents and Settings\mohammed\Desktop\wkotesting.xls;IMEX=1',
'SELECT * FROM [sheet2$]') inner join dbo.imc on
dbo.imc.imc_itemid= Sheet2.wko_itemid inner join dbo.ima on
dbo.ima.ima_itemid =dbo.imc.imc_itemid

But i am getting error message "The column prefix 'Sheet2' does not match with a table name or alias name used in the query".

Please Help me to link sql table field and excel sheet column.

Thanks
Aug 2 '07 #2
azimmer
200 Expert 100+
Hi,
I am trying to link sql table field and excel sheet column.

SELECT wko_itemid, imc_qty, ima_price
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Documents and Settings\mohammed\Desktop\wkotesting.xls;IMEX=1',
'SELECT * FROM [sheet2$]') inner join dbo.imc on
dbo.imc.imc_itemid= Sheet2.wko_itemid inner join dbo.ima on
dbo.ima.ima_itemid =dbo.imc.imc_itemid

But i am getting error message "The column prefix 'Sheet2' does not match with a table name or alias name used in the query".

Please Help me to link sql table field and excel sheet column.

Thanks
I'm not 100% sure it works but have you given a try to
Expand|Select|Wrap|Line Numbers
  1. SELECT wko_itemid, imc_qty, ima_price 
  2. FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
  3.                'Excel 8.0;Database=C:\Documents and Settings\mohammed\Desktop\wkotesting.xls;IMEX=1',
  4.                'SELECT * FROM [sheet2$]') Sheet2 inner join dbo.imc on 
  5. dbo.imc.imc_itemid= Sheet2.wko_itemid  inner join dbo.ima on
  6. dbo.ima.ima_itemid =dbo.imc.imc_itemid
  7.  
Aug 2 '07 #3
imtmub
112 100+
I tried but still its giving the error like 'OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. The provider did not give any information about the error.'. I don't have idea what kind of error i am getting. Anyhave i am googling untill i will find solution.
Aug 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
12
by: jimserac | last post by:
I had previously posted this in an Access forum with negative results so will try here. Although this question specifies an Access database, I also wish to accomplish this with a large MS SQL...
3
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown....
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
3
by: don | last post by:
I have written a program to hold a sales contact db. It is written in c# express. an update is sent from head office in xl format, i need to import only the new rows to an access database. I...
2
by: LittlePhil via AccessMonster.com | last post by:
Someone please help before i start to cry. I'm trying to export from Access to Excel, then create a new excel sheet with a pivot table to display the data held in columns A:P. I get the error...
0
by: MathewJose | last post by:
Hi, How do we create a datatable in which you can join the data from excel sheet and db ?I need to use the new table as the datasource IPlz help!!!
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
1
by: CoreyReynolds | last post by:
I can't find any information on this. If I have an existing query and I want to dump it into a page on a spread sheet and modify it as a pivot table all in VBA, can I do that? I only have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.