SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


series of transactions


series of transactions

Author
Message
salomon.frid
salomon.frid
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 15
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)

Group: General Forum Members
Points: 222573 Visits: 46293
If you want to wait, that's WAITFOR with either delay or time.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


salomon.frid
salomon.frid
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 15
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?
Keith Tate
Keith Tate
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2304 Visits: 979
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
Michael Valentine Jones
Michael Valentine Jones
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14339 Visits: 11848
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.
salomon.frid
salomon.frid
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 15
Truth be told, is part of what I am trying to find out as well :-)
Keith Tate
Keith Tate
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2304 Visits: 979
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)

Group: General Forum Members
Points: 222573 Visits: 46293
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, MVP, M.Sc (Comp Sci)
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


GilaMonster
GilaMonster
SSC Guru
SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)SSC Guru (222K reputation)

Group: General Forum Members
Points: 222573 Visits: 46293
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, MVP, M.Sc (Comp Sci)
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


Eirikur Eiriksson
Eirikur Eiriksson
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40282 Visits: 19452
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
Cool
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search