Forum Replies Created

Viewing 3 posts - 1 through 4 (of 4 total)

  • RE: Msg 102, Level 15, State 1, Line 16

    DECLARE @sql nvarchar(max);

    DECLARE @FromDate char(8);

    DECLARE @ToDate char(20);

    DECLARE @PathFileName varchar(2000);

    SET @FromDate = 20080101;

    SET @ToDate = CONVERT(CHAR(20),GETDATE(),112);

    SET @PathFileName = 'D:\SalesHis\SALES.'+@FromDate+'%''.txt';

    WHILE (@ToDate > @FromDate)

    SELECT @sql = 'BULK INSERT [SalesHis].[DBO].[Sales] FROM '+@PathFileName+'

    WITH (FIELDTERMINATOR...

  • RE: Msg 102, Level 15, State 1, Line 16

    My Text File format is Sales.YYYYMMDDHHMMSS.txt

    So my plan is running a query that can loop from 20080101 till today so i can import all the data to the database.

    Please...

  • RE: Msg 102, Level 15, State 1, Line 16

    Sorry, new error message come out.......

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near 'D'.

    Msg 105, Level 15, State 1, Line 3

    Unclosed quotation mark after the character string ')'.

    Have...

Viewing 3 posts - 1 through 4 (of 4 total)