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

loading data from text files

Ted
In MySQL, I use "LOAD DATA INFILE 'my_path/data_file.txt'" to load data
from a plain text file. Of course, the actual statement is a bit more
complex once one considers the various options (e.g. comma delimited vs
tab delimited, record termination strings, &c.).

My problem is that I have yet to find the equivalent within MS SQL
server. I did find a LOAD statement in T-SQL, but at first glance it
seems to do something completely different.

How does one normally load data from a plain text file into a table in
MS SQL? This needs to be relatively efficient since, once in
production, it will be used to load tens of megabytes of data into the
database (a feed from a data provider). Is it flexible enough to allow
me to specify whether the fields are tab delimited vs comma delimited,
optionally enclosed by quotes, record termination charactors, &c.?

All I really need is direction to the right part of the T-SQL reference
(MS SQL Server 2005). Anything else, such as examples, is icing on the
cake.

Thanks

Ted

Aug 4 '06 #1
2 3804
On 3 Aug 2006 17:53:42 -0700, "Ted" <r.*********@rogers.comwrote:
>In MySQL, I use "LOAD DATA INFILE 'my_path/data_file.txt'" to load data
from a plain text file. Of course, the actual statement is a bit more
complex once one considers the various options (e.g. comma delimited vs
tab delimited, record termination strings, &c.).

My problem is that I have yet to find the equivalent within MS SQL
server. I did find a LOAD statement in T-SQL, but at first glance it
seems to do something completely different.

How does one normally load data from a plain text file into a table in
MS SQL? This needs to be relatively efficient since, once in
production, it will be used to load tens of megabytes of data into the
database (a feed from a data provider). Is it flexible enough to allow
me to specify whether the fields are tab delimited vs comma delimited,
optionally enclosed by quotes, record termination charactors, &c.?

All I really need is direction to the right part of the T-SQL reference
(MS SQL Server 2005). Anything else, such as examples, is icing on the
cake.
I believe you're looking for SQL Server Integration Services (formerly
Data Transformation Services for SQL 2000).
Aug 4 '06 #2
Look at the external bcp utility command.

T-SQL command BULK INSERT

And as stated in the other reply SQL Server Integration Services.

Tim S

"Ted" <r.*********@rogers.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
In MySQL, I use "LOAD DATA INFILE 'my_path/data_file.txt'" to load data
from a plain text file. Of course, the actual statement is a bit more
complex once one considers the various options (e.g. comma delimited vs
tab delimited, record termination strings, &c.).

My problem is that I have yet to find the equivalent within MS SQL
server. I did find a LOAD statement in T-SQL, but at first glance it
seems to do something completely different.

How does one normally load data from a plain text file into a table in
MS SQL? This needs to be relatively efficient since, once in
production, it will be used to load tens of megabytes of data into the
database (a feed from a data provider). Is it flexible enough to allow
me to specify whether the fields are tab delimited vs comma delimited,
optionally enclosed by quotes, record termination charactors, &c.?

All I really need is direction to the right part of the T-SQL reference
(MS SQL Server 2005). Anything else, such as examples, is icing on the
cake.

Thanks

Ted

Aug 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cmars | last post by:
Hi, I want to insert massive amounts of data in near real-time into a MySQL database. The data is in a structured binary format, and I have code that parses the data into logical data structures. ...
4
by: Ram | last post by:
We are trying to load text tab delimited files into SQL server using informatica 5.1 version. The text files are FTPed to a local server and then files are moved to applicable folder before...
1
by: Mike Husler | last post by:
We tried to load a file that contained 1 column of datetimes of the format yyyy-MM-dd hh:mm:ss into a table that had the column set as a datetime type. We did this using a DTS package. The error...
1
by: ozzy.osborn | last post by:
Hello All, I have been struggling with a cross browser solution to loading external javascript files on the fly. I have been successful using the following code in IE6: var newScr =...
8
by: jhoff | last post by:
So, I'm in a pickle... Lets say I have a page: http://www.gen2host.com/discgolf/index.html and on this page, there are a list of links. These links will be generated by 5 pieces of data pulled...
6
by: Venkatesh | last post by:
Hello All, I have couple of doubts regarding the concept of on-demand javascript loading using javascript code. I could see on the net different techniques for achieving this - techniques like:...
5
by: yeoj13 | last post by:
Hello, I have a db2load script I'm using to populate a large table. Ideally, my target table is required to have "Not Null" constraints on a number of different columns. I've noticed a ...
0
by: NickW | last post by:
I have written a stored procedure that is used to load data into a SQL Server 2000 and 2005 databases from some 40ish different text files. One of the text files is loading all of the rows apart from...
15
by: pdhb_1 | last post by:
I'm trying to run Apache2.2.6 with php. However, I keep getting a long list of error messages in the log file indicating that includes are failing. For example, "PHP Warning: PHP Startup:...
9
by: igor.tatarinov | last post by:
Hi, I am pretty new to Python and trying to use it for a relatively simple problem of loading a 5 million line text file and converting it into a few binary files. The text file has a fixed format...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.