I am outputting a list of insert commands from MS SQL Server using SQLCMD to a flat file.

When I try and run this file in DBISQL (ASA 9) I am being told there is an illegal character '/n' on line 2.

I have tried all sorts of commands in SQLCMD, but I keep getting this error. Is there anything I can do to remove this character in DBISQL?

When the SQL file is viewed in Interactive SQL there are no problems with the file.

asked 22 Nov, 10:46

Jongee's gravatar image

Jongee
187111219
accept rate: 0%

edited 22 Nov, 11:57


There is most likely a syntax error that is being poorly diagnosed; e.g., the SQL parser has run off the end of the SQL code before realizing there is something wrong.

The bottom line is, there is no invalid /n character... look for some other problem.

One technique is to delete chunks of text until the code works, then look at the most recently-deleted chunk to find the problem.

permanent link

answered 22 Nov, 11:07

Breck%20Carter's gravatar image

Breck Carter
27.0k446617889
accept rate: 21%

Thanks, I will give this a go. Viewing the code in ISQL reports there are no issues.

(22 Nov, 11:27) Jongee

Did you add a semicolon at the end of each statement or put a 'go' on a new line between statements?

permanent link

answered 22 Nov, 11:16

John%20Smirnios's gravatar image

John Smirnios
9.0k377114
accept rate: 39%

I have a semicolon at the end of each statement.

(22 Nov, 11:26) Jongee
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×102
×82

question asked: 22 Nov, 10:46

question was seen: 85 times

last updated: 22 Nov, 11:58