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!

Printing to screen in Stored Procedures

Status
Not open for further replies.

seekwall

Programmer
May 14, 2001
41
GB
I need to be able to print a message to the screen in query analyser at the beginning of a stored proc. The message however only appears once the batch has finished running. How can I ensure that the message appears as soon as the procedure is executed ?
 
Hiya,

There is nothing you can actually do to force SQL server to print a message any quicker. Basically, it will do all print to screens to a buffer, and only when the buffer is full, will it actually print the details to screen.

This is very frustrating, but the only way around it is to run any stored procs from ISQL (if you have that installed). Then prints will be returned as soon as they are processed by the system.

Tim
 
Cheers Tim

But what is ISQL? I am quite new to all this

 
Hi,

ISQL is a command line program that runs from either a DOS or a Unix command line.

Its format is

ISQL -Uuser_name -Sserver_name -Ppassword

You can then use any standard SQL commands, remembering to enter "go" as a command to execute your statements, so to run a stored proc from the command line will be:

EXEC stored_procedure
GO

ISQL is very useful, as it sends commands directly to and from the database server, instead of through any middle applications, such as query analyzer, so processing times are quicker. It is, however, impossible to edit in ISQL, so writing programs there is still not recommended.

You could also try an internet search on ISQL for more information.

HTH

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top