Count down from 0 to 5 seconds and repeat [closed]Reducing high VLF countCan SQL Server 2008 R2 extended events execute stored procedure or query?sp_GetAppLock slow performance unusual behaviourQuery for total downtime of site using datestamps and status columnsImproving a DbGeography queryAdding columns from joined table slows down query incrediblyPerformance issue with sp_executesql and VARCHAR parameterEXECUTE AS USER = 'dbo' - The user does not have permission to perform this actionWhy does this query take so long to execute?How can I use Count() or Sum() with advanced criteria such as matching the most recent rows where a condition is true?
Why do we use the Greek letter μ (Mu) to denote population mean or expected value in probability and statistics
How could a sequence of random dates be generated, given year interval?
How to apply a macro for every single matching pattern
Is dark matter inside galaxies different from dark matter in intergalactic space?
Proof that if covariance is zero then there is no linear relationship
Why are the Ukraine related congressional hearings behind closed doors?
Why did Grima shed a tear?
In Cura, can I make my top and bottom layer be all perimiters?
If a tournament advertises G/30, can either player demand G/25 d5?
Alias to open a graphical Program (nautilus) opens it in Terminal too
Command which removes data left side of ";" (semicolon) on each row
Doubt on finding simplex's initial canonical tableau (II Phase)
How does AT-AT deploy troops?
Why are bagpipes tuned using just intonation?
Remove vertical space in gather enviroment
Novel in which space traders train a spearman army for a decaying medieval empire
What's a good strategy for offering low on a house?
We know someone is scrying on us. Is there anything we can do about it?
Sci-fi book trilogy about space travel & 'jacking'
More elegant way to express ((x == a and y == b) or (x == b and y == a))?
Starting a fire in a cold planet that has full of flammable gas
What's the most profitable use for an elemental transmuter?
Protecting Seals from Forgery
Why does the SR-71 Blackbird sometimes have dents in the nose?
Count down from 0 to 5 seconds and repeat [closed]
Reducing high VLF countCan SQL Server 2008 R2 extended events execute stored procedure or query?sp_GetAppLock slow performance unusual behaviourQuery for total downtime of site using datestamps and status columnsImproving a DbGeography queryAdding columns from joined table slows down query incrediblyPerformance issue with sp_executesql and VARCHAR parameterEXECUTE AS USER = 'dbo' - The user does not have permission to perform this actionWhy does this query take so long to execute?How can I use Count() or Sum() with advanced criteria such as matching the most recent rows where a condition is true?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
What query can I use to trigger a count down from 0 to 5 seconds whenever executed? When I execute a query the output has to be 0 second to 5 second and once 5 seconds are done again it should go back to 0. When I execute again it should start from 0 to 5 seconds. Is it possible to achieve something like this using sql query?
sql-server
closed as unclear what you're asking by Marcello Miorelli, Colin 't Hart, Andriy M, Marco, mustaccio Jun 3 at 14:36
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment
|
What query can I use to trigger a count down from 0 to 5 seconds whenever executed? When I execute a query the output has to be 0 second to 5 second and once 5 seconds are done again it should go back to 0. When I execute again it should start from 0 to 5 seconds. Is it possible to achieve something like this using sql query?
sql-server
closed as unclear what you're asking by Marcello Miorelli, Colin 't Hart, Andriy M, Marco, mustaccio Jun 3 at 14:36
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Can I just clarify, do you want to output a count after each second, or just simply wait for 5 seconds. You say the "output" has to be 0 to 5 seconds
– George.Palacios
May 31 at 14:44
2
It's unclear what you're actually hoping to achieve here. Certainly, you don't want to just show a countdown on the screen or waste CPU cycles. What are you going to do with this countdown? Other tools are probably more appropriate than a database for them.
– jpmc26
Jun 1 at 9:38
"Count down from 0 to 5"? Do you mean 0, 1, 2, 3, 4, 5 or 5, 4, 3, 2, 1, 0?
– John Eisbrener
Jun 3 at 13:26
add a comment
|
What query can I use to trigger a count down from 0 to 5 seconds whenever executed? When I execute a query the output has to be 0 second to 5 second and once 5 seconds are done again it should go back to 0. When I execute again it should start from 0 to 5 seconds. Is it possible to achieve something like this using sql query?
sql-server
What query can I use to trigger a count down from 0 to 5 seconds whenever executed? When I execute a query the output has to be 0 second to 5 second and once 5 seconds are done again it should go back to 0. When I execute again it should start from 0 to 5 seconds. Is it possible to achieve something like this using sql query?
sql-server
sql-server
asked May 31 at 14:37
svisveshsvisvesh
192 bronze badges
192 bronze badges
closed as unclear what you're asking by Marcello Miorelli, Colin 't Hart, Andriy M, Marco, mustaccio Jun 3 at 14:36
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Marcello Miorelli, Colin 't Hart, Andriy M, Marco, mustaccio Jun 3 at 14:36
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Marcello Miorelli, Colin 't Hart, Andriy M, Marco, mustaccio Jun 3 at 14:36
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Can I just clarify, do you want to output a count after each second, or just simply wait for 5 seconds. You say the "output" has to be 0 to 5 seconds
– George.Palacios
May 31 at 14:44
2
It's unclear what you're actually hoping to achieve here. Certainly, you don't want to just show a countdown on the screen or waste CPU cycles. What are you going to do with this countdown? Other tools are probably more appropriate than a database for them.
– jpmc26
Jun 1 at 9:38
"Count down from 0 to 5"? Do you mean 0, 1, 2, 3, 4, 5 or 5, 4, 3, 2, 1, 0?
– John Eisbrener
Jun 3 at 13:26
add a comment
|
1
Can I just clarify, do you want to output a count after each second, or just simply wait for 5 seconds. You say the "output" has to be 0 to 5 seconds
– George.Palacios
May 31 at 14:44
2
It's unclear what you're actually hoping to achieve here. Certainly, you don't want to just show a countdown on the screen or waste CPU cycles. What are you going to do with this countdown? Other tools are probably more appropriate than a database for them.
– jpmc26
Jun 1 at 9:38
"Count down from 0 to 5"? Do you mean 0, 1, 2, 3, 4, 5 or 5, 4, 3, 2, 1, 0?
– John Eisbrener
Jun 3 at 13:26
1
1
Can I just clarify, do you want to output a count after each second, or just simply wait for 5 seconds. You say the "output" has to be 0 to 5 seconds
– George.Palacios
May 31 at 14:44
Can I just clarify, do you want to output a count after each second, or just simply wait for 5 seconds. You say the "output" has to be 0 to 5 seconds
– George.Palacios
May 31 at 14:44
2
2
It's unclear what you're actually hoping to achieve here. Certainly, you don't want to just show a countdown on the screen or waste CPU cycles. What are you going to do with this countdown? Other tools are probably more appropriate than a database for them.
– jpmc26
Jun 1 at 9:38
It's unclear what you're actually hoping to achieve here. Certainly, you don't want to just show a countdown on the screen or waste CPU cycles. What are you going to do with this countdown? Other tools are probably more appropriate than a database for them.
– jpmc26
Jun 1 at 9:38
"Count down from 0 to 5"? Do you mean 0, 1, 2, 3, 4, 5 or 5, 4, 3, 2, 1, 0?
– John Eisbrener
Jun 3 at 13:26
"Count down from 0 to 5"? Do you mean 0, 1, 2, 3, 4, 5 or 5, 4, 3, 2, 1, 0?
– John Eisbrener
Jun 3 at 13:26
add a comment
|
2 Answers
2
active
oldest
votes
WaitFor should help you accomplish this.
In your case we can simply pass a DELAY time as below
WAITFOR DELAY '00:00:05';
This will simply wait for 5 seconds, then return to the caller.
add a comment
|
Have you looked into the waitfor delay command? See below example
while 1=1
begin
--do something
waitfor delay '00:00:05'
end
add a comment
|
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
WaitFor should help you accomplish this.
In your case we can simply pass a DELAY time as below
WAITFOR DELAY '00:00:05';
This will simply wait for 5 seconds, then return to the caller.
add a comment
|
WaitFor should help you accomplish this.
In your case we can simply pass a DELAY time as below
WAITFOR DELAY '00:00:05';
This will simply wait for 5 seconds, then return to the caller.
add a comment
|
WaitFor should help you accomplish this.
In your case we can simply pass a DELAY time as below
WAITFOR DELAY '00:00:05';
This will simply wait for 5 seconds, then return to the caller.
WaitFor should help you accomplish this.
In your case we can simply pass a DELAY time as below
WAITFOR DELAY '00:00:05';
This will simply wait for 5 seconds, then return to the caller.
answered May 31 at 14:41
George.PalaciosGeorge.Palacios
4,69512 silver badges37 bronze badges
4,69512 silver badges37 bronze badges
add a comment
|
add a comment
|
Have you looked into the waitfor delay command? See below example
while 1=1
begin
--do something
waitfor delay '00:00:05'
end
add a comment
|
Have you looked into the waitfor delay command? See below example
while 1=1
begin
--do something
waitfor delay '00:00:05'
end
add a comment
|
Have you looked into the waitfor delay command? See below example
while 1=1
begin
--do something
waitfor delay '00:00:05'
end
Have you looked into the waitfor delay command? See below example
while 1=1
begin
--do something
waitfor delay '00:00:05'
end
answered May 31 at 14:40
kevinnwhatkevinnwhat
1,2221 gold badge1 silver badge11 bronze badges
1,2221 gold badge1 silver badge11 bronze badges
add a comment
|
add a comment
|
1
Can I just clarify, do you want to output a count after each second, or just simply wait for 5 seconds. You say the "output" has to be 0 to 5 seconds
– George.Palacios
May 31 at 14:44
2
It's unclear what you're actually hoping to achieve here. Certainly, you don't want to just show a countdown on the screen or waste CPU cycles. What are you going to do with this countdown? Other tools are probably more appropriate than a database for them.
– jpmc26
Jun 1 at 9:38
"Count down from 0 to 5"? Do you mean 0, 1, 2, 3, 4, 5 or 5, 4, 3, 2, 1, 0?
– John Eisbrener
Jun 3 at 13:26