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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Displaying status to user

Author  Topic 

allend2010
Starting Member

28 Posts

Posted - 2003-07-23 : 14:36:04
Hello:

I am using oSQL within a batch file to execute a stored procedure. In the sp, I have 3 large insert statements that take awhile. What I would like to do is after each insert segment is complete, is to write to the stdout that that portion of processing has completed. I tried using the PRINT statement but it didn't display until after the entire process completed:

INSERT INTO ...
PRINT 'Finished first section'
INSERT INTO ...
PRINT 'Finished second section...
and so on...

I was wondering if anybody knows a way to accomplish this so that I can just show on the screen that something is happening.

Much thanks in advance,
Allen D.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-07-23 : 14:46:04
I do not believe that you are going to be able to do that. osql outputs when the specific task has completed and not during. You could use xp_cmdshell in your stored procedure to write something out to a file, but you'll have to check that file every so often to find out its status.

Tara
Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-07-23 : 15:05:45
use
raiserror('qqqqqqqqq', 2, 1) with nowait
instead of
print 'qqqqqqqqq'

- Vit
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-07-23 : 15:27:29
Cool! I didn't know that you get could do that. I knew about the RAISERROR but didn't know about using it like this.

Tara
Go to Top of Page

allend2010
Starting Member

28 Posts

Posted - 2003-07-23 : 15:50:44
Thanks folks, I'll give it a try...

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-23 : 15:58:37
You could also net send a message to yourself

master..xp_cmdshell 'NET SEND [yourId] First load finished'



Brett

8-)
Go to Top of Page
   

- Advertisement -