Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
but I would like the SELECTs to display immediately - so that I can manually abort it in the middle of a WAITFOR, and not in the middle of the SProc Suggestions pls?Kristen
spirit1
Cybernetic Yak Master
11752 Posts
Posted - 2007-10-01 : 05:28:38
you can't with selects but you can with raiserror:
WHILE 1 = 1BEGIN RAISERROR (N'Backup', -- Message text. 10, -- Severity, 1) -- State); -- Second argument. WITH NOWAIT select top 1 * from orders RAISERROR (N'Waitfor', -- Message text. 10, -- Severity, 1) -- State); -- Second argument. WITH NOWAIT WAITFOR DELAY '00:05:00'END
_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com
Kristen
Test
22859 Posts
Posted - 2007-10-01 : 05:29:15
"RAISERROR"Would never have thought of that, thanks.Kristen
spirit1
Cybernetic Yak Master
11752 Posts
Posted - 2007-10-01 : 05:35:38
that's why we're here _______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com
Kristen
Test
22859 Posts
Posted - 2007-10-01 : 06:10:44
It even "pushes" the results from any earlier SELECTs, which suits me Just Fine.
WHILE 1=1BEGIN SELECT 'Backup', GetDate() RAISERROR (N'Backup Start', 10, 1) WITH NOWAIT exec MyBackupSproc RAISERROR (N'Backup End', 10, 1) WITH NOWAIT SELECT 'Waitfor', GetDate() WAITFOR DELAY '00:05:00'END
Kristen
spirit1
Cybernetic Yak Master
11752 Posts
Posted - 2007-10-01 : 06:18:57
cool isn't it _______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com