Home > Archive > MS SQL Server > January 2006 > Select query from a file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Select query from a file
Bigal

2006-01-23, 8:23 pm

Is there a way to create a Select query using a file without having to import
it into a table. I need to match inventory data that is in an excel file via
UPC column to our inventory table in the SQL server.

Thanks in advance..
Sue Hoegemeier

2006-01-24, 9:23 am

You can use Opendatasource to query the Excel file. An
example would be something like:
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="C:\YourExcelFile.xls";
User ID=Admin;Password=;E
xtended properties=Excel
8.0')...Sheet1$

-Sue

On Mon, 23 Jan 2006 14:07:57 -0800, "Bigal"
<Bigal@discussions.microsoft.com> wrote:

>Is there a way to create a Select query using a file without having to import
>it into a table. I need to match inventory data that is in an excel file via
>UPC column to our inventory table in the SQL server.
>
>Thanks in advance..


Bigal

2006-01-24, 8:23 pm

Could I then create a Join to a table in SQL server ?

"Sue Hoegemeier" wrote:

> You can use Opendatasource to query the Excel file. An
> example would be something like:
> SELECT *
> FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source="C:\YourExcelFile.xls";
> User ID=Admin;Password=;E
xtended properties=Excel
> 8.0')...Sheet1$
>
> -Sue
>
> On Mon, 23 Jan 2006 14:07:57 -0800, "Bigal"
> <Bigal@discussions.microsoft.com> wrote:
>
>
>

Sue Hoegemeier

2006-01-24, 8:23 pm

Yes - you can reference just like you would a table. There
is a similar example in books online under openrowset. You'd
go about it the same way.

-Sue

On Tue, 24 Jan 2006 13:05:25 -0800, "Bigal"
<Bigal@discussions.microsoft.com> wrote:
[color=darkred]
>Could I then create a Join to a table in SQL server ?
>
>"Sue Hoegemeier" wrote:
>

Bigal

2006-01-26, 4:53 pm

Great.
Thanks

"Sue Hoegemeier" wrote:

> Yes - you can reference just like you would a table. There
> is a similar example in books online under openrowset. You'd
> go about it the same way.
>
> -Sue
>
> On Tue, 24 Jan 2006 13:05:25 -0800, "Bigal"
> <Bigal@discussions.microsoft.com> wrote:
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com