This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > FrontPage Programming > December 2005 > import txt file to SQL Server DB table using ASP 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 |
import txt file to SQL Server DB table using ASP file. . .
|
|
|
| Using VB script i will need to import text file from c:\data.txt to SQL
Server DB table (table name 'tblData'). Also if i can run vb script from asp
file using button import. Please, help me write this script.
| |
| Thomas A. Rowe 2005-12-27, 6:52 pm |
| Suggest you post this to the MS SQL newsgroup as this is not a FP related issue.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
"GGill" <GGill@discussions.microsoft.com> wrote in message
news:55B171C8-0DDE-4D95-844F-3FF3E8794707@microsoft.com...
> Using VB script i will need to import text file from c:\data.txt to SQL
> Server DB table (table name 'tblData'). Also if i can run vb script from asp
> file using button import. Please, help me write this script.
| |
| Jon Spivey 2005-12-27, 6:52 pm |
| Hi,
This is the neat way
BULK INSERT TableName
FROM 'c:\stuff.csv'
WITH (
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
Check BULK INSERT in books online for all the options. The only problem is
many hosts block this so unless you're on a dedicated box you may have
problems using it. The other way would be to read the file with
filesystemobject split it into an array then do an insert for each row.
--
Cheers,
Jon
Microsoft MVP
"GGill" <GGill@discussions.microsoft.com> wrote in message
news:55B171C8-0DDE-4D95-844F-3FF3E8794707@microsoft.com...
> Using VB script i will need to import text file from c:\data.txt to SQL
> Server DB table (table name 'tblData'). Also if i can run vb script from
> asp
> file using button import. Please, help me write this script.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|