Hi... I am trying to create a batch file out of some query results. I need a few standard lines above and below my query results texts.
For example, I need it to look like this:
@@echo off
echo.
echo.
if not exist file1.doc echo file1.doc does not exist
if not exist file2.doc echo file2.doc does not exist
if not exist file3.doc echo file3.doc does not exist
echo.
echo.
pause
The SQL part of my script looks like this:
Any idea how I can get the echos and the pause on their own lines? I'm hoping to create a SQL statement my user can copy/paste into a new .bat file each day or have the SQL statement create the .bat file for them.
I tried just having the echo's and pause as a template in an existing file but they wouldn't paste my SQl stements in the right spot. Hoping I can just have it all created for them.
This is SQL 2000.
Thanks!
For example, I need it to look like this:
@@echo off
echo.
echo.
if not exist file1.doc echo file1.doc does not exist
if not exist file2.doc echo file2.doc does not exist
if not exist file3.doc echo file3.doc does not exist
echo.
echo.
pause
The SQL part of my script looks like this:
Code:
select 'if not exist ' + col001 + ' echo ' + col001 + ' does not exist'
Any idea how I can get the echos and the pause on their own lines? I'm hoping to create a SQL statement my user can copy/paste into a new .bat file each day or have the SQL statement create the .bat file for them.
I tried just having the echo's and pause as a template in an existing file but they wouldn't paste my SQl stements in the right spot. Hoping I can just have it all created for them.
This is SQL 2000.
Thanks!