Click here to Skip to main content
15,881,709 members
Home / Discussions / Database
   

Database

 
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 
QuestionRe: Resetting Value of Each User At Once (PHP MYSQLI) Pin
Richard MacCutchan4-Dec-20 23:05
mveRichard MacCutchan4-Dec-20 23:05 
QuestionThe Best Free Database for real-time data storing and querying Pin
Member 1332584625-Oct-20 20:04
Member 1332584625-Oct-20 20:04 
AnswerRe: The Best Free Database for real-time data storing and querying Pin
Victor Nijegorodov25-Oct-20 21:39
Victor Nijegorodov25-Oct-20 21:39 
GeneralRe: The Best Free Database for real-time data storing and querying Pin
Member 1332584627-Oct-20 22:17
Member 1332584627-Oct-20 22:17 
GeneralRe: The Best Free Database for real-time data storing and querying Pin
Richard MacCutchan27-Oct-20 23:09
mveRichard MacCutchan27-Oct-20 23:09 
GeneralRe: The Best Free Database for real-time data storing and querying Pin
Member 1332584628-Oct-20 0:26
Member 1332584628-Oct-20 0:26 
GeneralRe: The Best Free Database for real-time data storing and querying Pin
Jörgen Andersson28-Oct-20 2:15
professionalJörgen Andersson28-Oct-20 2:15 

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.