The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.


I'm having trouble trying to output the the table to a file:

IF (NumRows > 0 ) THEN
MESSAGE 'We have not had backups for more than 2 hours! Affected volumes are: ';
SELECT * FROM LatestBackup WHERE datediff (minute, ExecTime, getdate()) < 130;
OUTPUT TO '/dir1/dir2/textfile FORMAT TEXT;

Such a code returns syntax error. While I'm executing SELECT and OUTPUT only, it works perfectly fine. Any ideas? Can't I use OUTPUT in a batch?

Thank you.

asked 17 Apr '14, 06:09

Maciej's gravatar image

accept rate: 0%

OUTPUT is a command which can only be used in the tool dbisql, but you can use the UNLOAD command instead.

permanent link

answered 17 Apr '14, 06:27

Martin's gravatar image

accept rate: 14%

Yeah. Just found out the UNLOAD statement. Thank you!

(17 Apr '14, 06:28) Maciej
Replies hidden

FWIW, as you have used the "output" tag yourself, that tag lists a whole bunch of FAQs and explanations to that topic:

(17 Apr '14, 06:53) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 17 Apr '14, 06:09

question was seen: 408 times

last updated: 17 Apr '14, 06:53