469,950 Members | 1,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

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 9378
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

Post your reply

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

Similar topics

13 posts views Thread by Allison Bailey | last post: by
9 posts views Thread by dba123 | last post: by
3 posts views Thread by don | last post: by
2 posts views Thread by LittlePhil via AccessMonster.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.