SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

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

Alan Learner
Starting Member

United Kingdom
4 Posts

Posted - 09/11/2013 :  06:40:07  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

940 Posts

Posted - 09/11/2013 :  07:37:29  Show Profile  Reply with Quote
it's executing your file using the "sql" program.
The flags will be specific to whatever program that is. Try sql -? and see what it says.
Go to Top of Page

Alan Learner
Starting Member

United Kingdom
4 Posts

Posted - 09/11/2013 :  07:46:47  Show Profile  Reply with Quote
Ok, thank you i will try using the -?.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000