Replacing double quote with single quote

  • Can someone please tell me what I did wrong here. I'd replaced the double quote with a single quote but it complained about Unclosed quotation mark before the character string '\n)'.

    HERE'S THE DOUBLE QUOTE VERSION:

    SET @Query_tmp = "BULK INSERT dbo.dbAnntest FROM '"+@TmpLocation+"' WITH (FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n')"

    AND HERE'S THE SINGLE QUOTE VERSION:

    SET @Query_tmp = 'BULK INSERT dbo.dbAnntest FROM '+@TmpLocation+' WITH (FIELDTERMINATOR = ''\t'', ROWTERMINATOR = ''\n)'

    Thanks

  • Must close the newline terminator ...

    SET @Query_tmp =

    'BULK INSERT dbo.dbAnntest FROM '+@TmpLocation+' WITH (FIELDTERMINATOR = ''\t'', ROWTERMINATOR = ''\n'')'

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply