BTEQ - Script structure in Teradata

To create and execute the BTEQ script in Teradata we have to follow the below mentioned steps -

Step 1: Create the BTEQ Script

To create and edit a BTEQ script we can use an text editor or client workstation.
.SET SESSION TRANSACTION ANSI
.LOGON TDUSER/tdpassword

<Query>

.QUIT


Step 2: Executing the script
Start BTEQ, then enter the following BTEQ command to submit a BTEQ script:
.RUN FILE = <bteqscriptname>


Note: We can also include comments in a BTEQ
     /* comments */

We can also use ANSI style (--) in any SQL command script.