Click here to Skip to main content
15,889,595 members
Home / Discussions / Database
   

Database

 
GeneralRe: WITSML Server And Client in C# Pin
Member 1332584614-Feb-21 22:53
Member 1332584614-Feb-21 22:53 
Generalneed website to create database Pin
Member 150643285-Feb-21 12:51
Member 150643285-Feb-21 12:51 
QuestionRe: need website to create database Pin
Eddy Vluggen5-Feb-21 13:09
professionalEddy Vluggen5-Feb-21 13:09 
GeneralRe: need website to create database Pin
RickZeeland5-Feb-21 20:19
mveRickZeeland5-Feb-21 20:19 
AnswerRe: need website to create database Pin
Slacker0076-Feb-21 2:33
professionalSlacker0076-Feb-21 2:33 
GeneralRe: need website to create database Pin
dandy726-Feb-21 3:16
dandy726-Feb-21 3:16 
GeneralRe: need website to create database Pin
Gerry Schmitz6-Feb-21 9:31
mveGerry Schmitz6-Feb-21 9:31 
QuestionFirebird : SQL to Get record today only Pin
kerek221-Jan-21 15:12
kerek221-Jan-21 15:12 
AnswerRe: Firebird : SQL to Get record today only Pin
Richard MacCutchan21-Jan-21 22:05
mveRichard MacCutchan21-Jan-21 22:05 
GeneralRe: Firebird : SQL to Get record today only Pin
kerek224-Jan-21 13:03
kerek224-Jan-21 13:03 
AnswerRe: Firebird : SQL to Get record today only Pin
Mycroft Holmes22-Jan-21 11:00
professionalMycroft Holmes22-Jan-21 11:00 
AnswerRe: Firebird : SQL to Get record today only Pin
DerekT-P23-Jan-21 8:18
professionalDerekT-P23-Jan-21 8:18 
GeneralRe: Firebird : SQL to Get record today only Pin
kerek224-Jan-21 13:09
kerek224-Jan-21 13:09 
QuestionRe: Firebird : SQL to Get record today only Pin
David Crow12-Mar-21 6:40
David Crow12-Mar-21 6:40 
QuestionSQL Server: Retry update if fail Pin
Mou_kol8-Jan-21 4:22
Mou_kol8-Jan-21 4:22 
SQL
create table PendingQueue (
   id int not null,
   DueTime datetime not null,
   Payload varbinary(max),
   cnstraint pk_pending_id nonclustered primary key(id));
    
 create clustered index cdxPendingQueue on PendingQueue (DueTime);
 go
    
 create procedure usp_enqueuePending
   @dueTime datetime,
   @payload varbinary(max)
 as
   set nocount on;
   insert into PendingQueue (DueTime, Payload)
     values (@dueTime, @payload);
 go
    
 create procedure usp_dequeuePending
   @batchsize int = 100,
   @retryseconds int = 600
 as
   set nocount on;
   declare @now datetime;
   set @now = getutcdate();
   with cte as (
     select top(@batchsize) 
       id,
       DueTime,
       Payload
     from PendingQueue with (rowlock, readpast)
     where DueTime < @now
     order by DueTime)
   update cte
     set DueTime = dateadd(seconds, @retryseconds, DueTime)
     output deleted.Payload, deleted.id;
 go


Specially see this line
set DueTime = dateadd(seconds, @retryseconds, DueTime)
How this line instruct sql server to retry the update data again after 10 minute if fail to update data first time. this is not clear to me. please some one explain if you understand properly. thanks
AnswerRe: SQL Server: Retry update if fail Pin
Richard Deeming8-Jan-21 4:49
mveRichard Deeming8-Jan-21 4:49 
QuestionSQL Server Difference among ROWLOCK ,UPDLock AND xlock Pin
Mou_kol8-Jan-21 4:19
Mou_kol8-Jan-21 4:19 
AnswerRe: SQL Server Difference among ROWLOCK ,UPDLock AND xlock Pin
Richard Deeming8-Jan-21 4:51
mveRichard Deeming8-Jan-21 4:51 
GeneralRe: SQL Server Difference among ROWLOCK ,UPDLock AND xlock Pin
Mou_kol8-Jan-21 5:01
Mou_kol8-Jan-21 5:01 
GeneralRe: SQL Server Difference among ROWLOCK ,UPDLock AND xlock Pin
Eddy Vluggen26-Jan-21 12:31
professionalEddy Vluggen26-Jan-21 12:31 
QuestionStoring Entity states in DB Pin
kabuto1787-Dec-20 16:31
kabuto1787-Dec-20 16:31 
AnswerRe: Storing Entity states in DB Pin
Richard Deeming7-Dec-20 22:36
mveRichard Deeming7-Dec-20 22:36 
GeneralRe: Storing Entity states in DB Pin
Mycroft Holmes8-Dec-20 10:56
professionalMycroft Holmes8-Dec-20 10:56 
GeneralRe: Storing Entity states in DB Pin
kabuto1789-Dec-20 13:35
kabuto1789-Dec-20 13:35 
QuestionResetting Value of Each User At Once (PHP MYSQLI) Pin
nateola444-Dec-20 22:14
nateola444-Dec-20 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.