Viewing 15 posts - 856 through 870 (of 1,402 total)
Here are two ways depending on whether GETDATE() returns the date you're interested in. If it does you could use something like this
/* use GETDATE() to determine...
September 26, 2020 at 2:13 am
My "favourite" response ever for that question is "do you mean now?"
We're in now now
September 25, 2020 at 2:30 pm
"How do you get the current date and time using T-SQL question that 20 out of 22 candidates couldn't answer before I stopped counting. It's NOT a trick question,...
September 25, 2020 at 2:12 pm
There's a documented process for submitting performance issues. In the footer of Jeff Moden's forum posts there's a link.
September 24, 2020 at 10:15 pm
Here's some code to test for what works
declare
@number1 varchar(12)='121',
@number2 varchar(12)='126';
select top(1) tp.number, tp.username
from (values ('4581265', 'J'), ('14121587', 'K')) tp(number, username)
where tp.number like '%'+@number1+'%'...
September 24, 2020 at 6:55 pm
Could each user entered number be assigned to a different variable? If you have number1 and number2 then something like this
select top(1) tp.number, tp.username, ...
from tb_phone tp
where...
September 24, 2020 at 5:06 pm
Recall the hamburger analogy. If the OP has eaten McDonalds before my gourmet burger is ready then they won't be hungry when it arrives.
September 23, 2020 at 11:27 pm
That's not how long the SQL code takes to execute. Tally based method would crush the OP's kludge especially as their test case is spanning thousands of days.
19 minutes is...
September 23, 2020 at 11:12 pm
Would you PLEASE post the actual test that you did on the first one we were talking about before moving on to another.
Yes, sorry. This is the preferred answer. ...
September 23, 2020 at 10:53 pm
Here's another one. It took 19 minutes vs 12 minutes for the rCTE. There's no sample data and no time for making any up. Hopefully the query is...
September 23, 2020 at 10:13 pm
Here's another one. It took 19 minutes vs 12 minutes for the rCTE. There's no sample data and no time for making any up. Hopefully the query is sound. It...
September 23, 2020 at 7:44 pm
Any time I've needed to populate a table of sequential numbers, I just done it by brute force. No recursion or fancy stuff. Remember the definition of place valued...
September 22, 2020 at 10:20 pm
Here's a set of comparisons between fnNumbers and fnTally
Performance comparison of fnNumbers vs fnTally inserting 10x row counts (n=1,000)
Performance comparison of fnNumbers vs fnTally inserting 10x row counts...
September 22, 2020 at 6:33 pm
Here are new Fiddles. The old Fiddles were not in this more popular Fiddle. There's more than one Fiddle FYI.
Performance comparison of fnNumbers vs fnNumbersRC inserting 10x row counts...
September 22, 2020 at 4:13 pm
If you look at my answer count v.s. the number of points I have and the position I have on Stack Overflow, you'll see that quantity doesn't matter much...
September 21, 2020 at 2:30 pm
Viewing 15 posts - 856 through 870 (of 1,402 total)