If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > import from file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-05-02, 06:27
carlosvs carlosvs is offline
Registered User
 
Join Date: Apr 2002
Posts: 1
Red face import from file

Hello every body.
I' m a guy from spain and this is my first message, and like you are going to check my english is not very good.
I have a problem with T-Sql in the SQL server 7.
I have to import data from files several times a day.
i'm trying to use de Bulk Insert command but i have problems with the variable witch contain the name of file:

set @file = 'c:\pruebas\lw' + char(@last + 1) + '.dat'
Bulk insert tbl_Latewar from @file with ( fieldterminator = ' ' , firstrow = 1 , lastrow = 1 )

it gives me a 170 error.
if you know another command to do this, please tell me.

if would help me i'll be very gratefully.
Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 04-25-02, 16:54
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
That error means there is a syntax probem.

Have you tried the same command but with the file name inserted instead of a variable ?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On