BTEQ script in BAT file

General covers Articles, Reference documentation, FAQs, Downloads and Blogs that do not belong to a specific subject area. General-purpose Articles about everything and anything

BTEQ script in BAT file


Hi All,


I have written a BTEQ script in BAT  file but when i double click this BAT file , it does not run and it only runs through command prompt in BTEQ mode.


Actually i am trying to run this BAT file through task scheduler so is there a way to run this BTEQ script in this BAT file in an automated way.



Teradata Employee

Re: BTEQ script in BAT file

Not sure what you are referring to as "BTEQ mode". The bteq script itself is not a valid .bat file, use some other extension for that.


The .bat file should have the "bteq" command with stdin redirected from the bteq script file.

For example, the batch file could be something like this:

bteq <bteq-script-file-name 2>&1 >output-log-file-name


(The 2>&1 redirects stderr to stdout so you capture any error messages in a single log, along with normal output.)