SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
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
 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: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.

MuMu88
Aged Yak Warrior

547 Posts

Posted - 09/11/2013 :  12:23:11  Show Profile  Reply with Quote
Refer to these:
http://technet.microsoft.com/en-us/library/ms188714(v=sql.105).aspx
http://technet.microsoft.com/en-us/library/ms165702(v=sql.105).aspx
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  
 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.11 seconds. Powered By: Snitz Forums 2000