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.
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.)
I would need more information as to the nature of the failure.
Did you check the History tab in Task Scheduler (or use the Windows Event Log viewer)?
Was the batch file launched? Was BTEQ invoked?