Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 What does “ > sql.txt && sql -h-1 -i sql.txt && de
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Alan Learner
Starting Member

United Kingdom
4 Posts

Posted - 09/11/2013 :  06:35:50  Show Profile  Reply with Quote
I am debugging some code that builds a SQL command which runs successfully.

However at the end of the query it looks as if the results of the query are written to a text file.

The full query is below

echo SELECT DATE,DATETABLE,DATE,APPDATE FROM CTD_ADF WHERE DATE IN (20130911) > sql.txt && sql -h-1 -i sql.txt && del sql.txt

I assume the " > sql.text " is basically saying create and write the results to a text file called sql.text?

And, at the end " && del sql.txt " deletes the sql.text file at the end of execution?

But what does the " && sql -h-1 -i sql.txt " commands do / mean?

I've tried researching the -h-1 -i commands but so far have not managed to find an answer.

Aged Yak Warrior

549 Posts

Posted - 09/11/2013 :  12:23:11  Show Profile  Reply with Quote
Refer to these:
Go to Top of Page

Alan Learner
Starting Member

United Kingdom
4 Posts

Posted - 09/12/2013 :  03:21:03  Show Profile  Reply with Quote
Thank you very much for this information.

This is very useful.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000