Advertisement

05.14.2008 at 09:43AM PDT, ID: 23402171
[x]
Attachment Details

help in t-sql logic for adding secs to a existing datetime variable

Asked by countrymeister in MS SQL Server, SQL Server 2005

Tags: ,

I want to achieve the follwing functionality
while (getdate() < @StartTime + @GiveupTimeout)
      call check proc
      check results of proc
      if success, do something
      if failure, sleep for a second

@StartTime is a datetime field, @@GiveupTimeout is some number that I want to add in secs
say I want to add three mins, call check_proc returns a scalar value @Result of type int

How do I specify a time interval to add to the datetime field (in this case 3 mins)Start Free Trial
[+][-]05.14.2008 at 09:44AM PDT, ID: 21566114

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Server 2005
Tags: t-SQL, T-SQL
Sign Up Now!
Solution Provided By: countrymeister
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.14.2008 at 09:52AM PDT, ID: 21566212

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 09:54AM PDT, ID: 21566227

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628