Write an SQL against an excel spreadsheet

Hi all

I have searched google for an answer to this question and I found a source, however, it doesn't seem to make sense to me. here is the code i used based on how I interpreted the source I found:

select * from [\\Cifs2\pop_lab$\P4P\Automation\2_EOL_Claims_ForDa shboard\Past Claims and Cohort\BCBSMA\FY19\BCBSMA_FY19_Received_Claims.xls x$]

But I get this error message:

Msg 208, Level 16, State 1, Line 1
Invalid object name '\Cifs2\pop_lab$\P4P\Automation\2_EOL_Claims_ForD ashboard\Past Claims and Cohort\BCBSMA\FY19\BCBSMA_FY19_Received_Claims.xls x$'.

Does anyone have any idea why this isn't working?

You cannot query an excel spreadsheet directly like that. are you trying to import the data in the excel file?

What is your end goal

Hi Yosiasz

I tried multiple ways to try to import it but i don't have authorization to add to the database. The end goal is to create the spreadsheet as a table. That way I can write a query against it.

I should say I want to be able to use it in a query

hi see these links


Thanks harishgg1
I have googled tat and read them, but when i used there example it didn't work

sometimes you can go to FORUMS ... of EXCEL .. and ask there also

sometimes .. there will lot of digging into 20 30 links before you can find an answer

good luck ..

OR may be you can think of other ways ideas

so import the excel spreadsheet into microsoft sql server table? if so you dont need to select it, you can use powershell or python or other scripting language of you preference. especially if you do not have permissions to install anything in sql server. and do you have permission to insert data into sql server database?