Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Test transaction from command line

Status
Not open for further replies.

MacFaza

IS-IT--Management
Jul 10, 2000
27
AR
Hi!
Thanks for your help in advance...
I don´t have knowledge in SQL server, and i need to make a transaction (query) from a Windows 2000 command line, to know if the SQL server and its data bases are alive.
How can i do it ?
This will be a script running every 5 minutes.
Thanks
Gustavo
Gustavo Faza
gfaza@usa.net

 

You can use the SQL Server utility program, OSQL, from the command line. The options used will depend on the security model used in SQL Server, the nature of the query, and whether the program runs on the server or another PC. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
YOu can write a script in Query Analyzer and then run osql from the command line using the -i option for input file. When you write your sql query in Query Analyzer save it and then on the command line type osql -ic:\tester.sql. This will launch that file and run anything in that file. Hope this helps
 
Thanks!
I will try it !
Gustavo
Gustavo Faza
gfaza@usa.net

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top