Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

series of transactions Expand / Collapse
Author
Message
Posted Thursday, July 31, 2014 2:24 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 31, 2014 3:16 PM
Points: 3, Visits: 2
I need to run a series of transactions on a table which i split into multiple groups of records, and then process one group at the time; This is due to locking and performance considerations.
I also want to pause between groups , allowing then other tasks to do their work ;
I have heard that wait function is not the prefer way of doing it; Any suggestions?

Salomon
Thanks
Post #1598484
Posted Thursday, July 31, 2014 3:02 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 10:25 AM
Points: 40,385, Visits: 36,827
If you want to wait, that's WAITFOR with either delay or time.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1598502
Posted Thursday, July 31, 2014 3:09 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 31, 2014 3:16 PM
Points: 3, Visits: 2
Thank you Gail
I am aware of that one, just some people in my shop have told me that is not the preferred way of doing this ...

Any alternatives?
Post #1598507
Posted Thursday, July 31, 2014 3:11 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 7:09 PM
Points: 593, Visits: 931
What is their reason for not using WAITFOR?



Microsoft Certified Master - SQL Server 2008
Follow me on twitter: @keith_tate

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1598508
Posted Thursday, July 31, 2014 3:15 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 11:06 PM
Points: 3,109, Visits: 11,514
salomon.frid (7/31/2014)
Thank you Gail
I am aware of that one, just some people in my shop have told me that is not the preferred way of doing this ...

Any alternatives?



You could ask the local "experts" that told you that is not the preferred way what the preferred method is. I would be curious to hear what they say.






Post #1598510
Posted Thursday, July 31, 2014 3:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 31, 2014 3:16 PM
Points: 3, Visits: 2
Truth be told, is part of what I am trying to find out as well
Post #1598512
Posted Thursday, July 31, 2014 3:19 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 7:09 PM
Points: 593, Visits: 931
salomon.frid (7/31/2014)
Truth be told, is part of what I am trying to find out as well
I would put the onus on them to say why it isn't preferred and use it until they can prove otherwise.




Microsoft Certified Master - SQL Server 2008
Follow me on twitter: @keith_tate

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1598513
Posted Thursday, July 31, 2014 3:20 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 10:25 AM
Points: 40,385, Visits: 36,827
salomon.frid (7/31/2014)
I am aware of that one, just some people in my shop have told me that is not the preferred way of doing this ...


So according to your local experts, WAITFOR is not the best way to wait for a period of time...
And their reason is?

Do they recommend against using kettles to boil water too?

Any alternatives?


Well, I suppose you could put a WHILE loop 1 to a few million with a select statement inside. That'll certainly cause a delay....
Or write the whole thing in C# and use it's sleep function. Or call out directly to the Windows API and it's thread suspend (but that could have some horrible side effects)



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1598514
Posted Thursday, July 31, 2014 3:21 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 10:25 AM
Points: 40,385, Visits: 36,827
salomon.frid (7/31/2014)
Truth be told, is part of what I am trying to find out as well


Go and ask them. They're the ones making the claim, the burden of proof is on them



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1598515
Posted Thursday, July 31, 2014 3:54 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 10:22 AM
Points: 2,391, Visits: 6,620
GilaMonster (7/31/2014)
salomon.frid (7/31/2014)
I am aware of that one, just some people in my shop have told me that is not the preferred way of doing this ...


So according to your local experts, WAITFOR is not the best way to wait for a period of time...
And their reason is?

Do they recommend against using kettles to boil water too?

Any alternatives?


Well, I suppose you could put a WHILE loop 1 to a few million with a select statement inside. That'll certainly cause a delay....
Or write the whole thing in C# and use it's sleep function. Or call out directly to the Windows API and it's thread suspend (but that could have some horrible side effects)


I like the last one, must remember to arrange the offsite backups before I try it
Post #1598522
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse