Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2002

    Red face Unanswered: 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.

  2. #2
    Join Date
    Feb 2002
    That error means there is a syntax probem.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts