473,419 Members | 1,570 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,419 software developers and data experts.

JOIN to a CSV file with OPENROWSET

code green
1,726 Expert 1GB
SQL server database can JOIN directly to a XLS spreadsheet using something like
Expand|Select|Wrap|Line Numbers
  1. LEFT JOIN OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;
  2. Database=\\servername\path\to\folder\foldername\Customers.xls',
  3. 'SELECT * FROM [Sheet1$]') xlsheet
  4. ON account_ref = customer.ref
Then read data using xlsheet.columnname.
I have a straightforward question.
How do I do similar but JOIN to a CSV file instead?
Sep 2 '10 #1
1 3062
ck9663
2,878 Expert 2GB
Two options:
1. BULK INSERT the CSV into a table and join that.
2. Find OPENROWSET's driver/connectivity string for TEXT files and use that.

Good Luck!!!

~~ CK
Sep 2 '10 #2

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

Similar topics

9
by: vKp | last post by:
I'm having a problem with file(). If I try to open a url of the form "http://example.com/find?one,two", I get an error of the following form: ....failed to create stream: Bad file descriptor... ...
12
by: aa | last post by:
I am trying to read a.php file from another PHP file using fgets() and display its contents. As a.php starts with <? the browser IE6 does not show anything, although I can see all the contents in...
3
by: Ot?vio | last post by:
Hi! I'm havin a problem about sending a binary file with fsockopen. My problem is solved when i do: -------------------->8------CODE----------------------------- <form...
5
by: jester.dev | last post by:
Hello, I'm learning Python from Python Bible, and having some problems with this code below. When I run it, I get nothing. It should open the file poem.txt (which exists in the current...
5
by: Karthikesh Raju | last post by:
Hi All, i am wondering about the best way to read in a configuration file that goes like: ########### source_dir = '/home/karthik/Projects/python' data_dir =...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
2
by: Gugale at Lincoln | last post by:
Hi, I am not able to execute following command from computers other than the SQL server itself. select * from openrowset(bulk N'\\ImageServer\Model\Cam_05.dwg', SINGLE_BLOB) as doc
9
by: cabrenner | last post by:
I am new to SQL Server, and migrating part of an Access application to SSE. I am trying to insert a comma delimited file into SSE 2005. I am able to run a BULK INSERT statement on a simple file,...
2
by: tezza98 | last post by:
Help please, im trying to use open OPENROWSET to import a csv file into my database Here is the code im using --Read CSV using OpenRowSet select * from OpenRowset('MSDASQL',...
1
code green
by: code green | last post by:
I need to combine data from SQL Server tables and a CSV file. This is the skeleton query SELECT customer 'Account', --Credit_Limit sage full_name Name, address,city,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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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.