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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 What does “ > sql.txt && sql -h-1 -i sql.txt && de

Author  Topic 

Alan Learner
Starting Member

4 Posts

Posted - 2013-09-11 : 06:35:50
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

549 Posts

Posted - 2013-09-11 : 12:23:11
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

4 Posts

Posted - 2013-09-12 : 03:21:03
Thank you very much for this information.

This is very useful.
Go to Top of Page
   

- Advertisement -