January 2, 2020 at 12:00 am
Comments posted to this topic are about the item Delaying the code
January 2, 2020 at 5:40 am
Nice question, thanks Steve.
...
January 2, 2020 at 10:14 am
between "WAITFOR DELAY '00:02.5':ย and "WAITFOR DELAY '00:02:00.5'" is the big difference
January 2, 2020 at 4:10 pm
BWAAAA-HAAAA-HAAAA!!!!ย I'm thinking that this question is the result of someone learning something the hard way! ๐ ๐ ๐
Great "gotcha" question, Steve!
--Jeff Moden
Change is inevitable... Change for the better is not.
January 2, 2020 at 4:45 pm
Not trying to be too tricky, but just struggling to come up with answers that might be plausible, or be easy mistakes to make. I haven't actually done this, mostly because I test the heck out of anything where I use this because I worry I'll format time wrong.
This code would never get edited in production without being tested somewhere.
January 2, 2020 at 6:37 pm
Right there with you on the "test the heck out of anything".
To be absolutely honest, I have no idea how you even came across this especially since it's not a documented time format (at least not one I've come across before).ย That makes it an even greater question.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 6, 2020 at 9:46 am
Back in the land of the connected (spent the last 2 weeks in the bush, in the middle of nowhere (no mobile connectivity)).
Nice reminder of the intricacies of the TIME datatype (especially the undocumented ones), thanks Steve
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
โlibera tute vulgaris exโ
January 6, 2020 at 9:50 am
Back in the land of the connected (spent the last 2 weeks in the bush, in the middle of nowhere (no mobile connectivity)).
Nice reminder of the intricacies of the TIME datatype (especially the undocumented ones), thanks Steve
The varchar
passed for WAITFOR
isn't parsed as a time
(or at least the SQL Server version of it).ย The value '00:02.5'
results in a conversion error if you try to convert it (to a time
), due to it missing the seconds before you get to the milliseconds:
SELECT CONVERT(time(1),'00:02.5') AS Delay;
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply