Viewing 15 posts - 3,241 through 3,255 (of 59,098 total)
There's something crazy going on with Jonathan's machine, Scott. Look at the results of your code in his run... it's all over the place.
I'll also say that on both my...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 6, 2022 at 2:13 am
Steve Collins wrote:Here's 1, 3, and 4
I was going to test this for performance but then noticed that it's not a complete answer 😮
The data types were added. It...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 6, 2022 at 2:06 am
Oh my! That's a crazy amount of difference, Jonathan... even from the runs for the same code. What else is running on your machine?
I'm running SQL Server 2017 Developer's Edition
The...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 6, 2022 at 2:02 am
For Question #1, Scott's method is the fastest. Don't take my word for it, though. Here's the test table...
--===== If the test table exists, drop it just...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 6, 2022 at 12:42 am
Here's 1, 3, and 4
--(1)
select v.sort_mo, input_str.mo
from (values ('Jan'),('Feb'),('Mar')) input_str(mo)
cross apply (values (parse(concat(input_str.mo, '-01-1900') as date))) v(sort_mo)
order by v.sort_mo;
I was going...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 6, 2022 at 12:01 am
ok, that's not what I thought you meant. I thought you meant flip all the bits.
This works for 0 and 1:
DECLARE @smallint smallint =...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 5, 2022 at 11:24 pm
ok, that's not what I thought you meant. I thought you meant flip all the bits.
This works for 0 and 1:
DECLARE @smallint smallint = 0
select...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 5, 2022 at 11:13 pm
What are the datatypes for the two columns in Question #1?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 5, 2022 at 10:32 pm
Probably so he can get away from having to run two separate queries and then merge the results with a distinct UNION. That may or may not be faster, though. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 5, 2022 at 2:41 am
I wonder if it is because in our dreams our minds are more focused on one thing at a time and it is easier without so many distractions.
I would...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 5, 2022 at 2:39 am
Perhaps more important than the DISTINCT keyword is the AVG() function's handling of NULL values.
NULLs behave similarly to DISTINCT - regardless of how AVG() is called. That is, the...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 4, 2022 at 5:52 pm
Heh... there is an EXCEPT, though... same "class" of method.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 4, 2022 at 5:09 pm
Just in case you're still around, the reason I'm asking is because, if the ultimate use is to import the data into another SQL Server, using BCP Out in the...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 4, 2022 at 4:54 pm
In other words, please read and heed the article at the first link in my signature line below for one of many methods to provide some "Readily Consumable Test Data"...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 4, 2022 at 3:54 pm
Please go back and read the reply from Scott Pletcher and myself.
I agree that it sounds like you're trying to do a server to server transfer. With the exception of...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 4, 2022 at 3:48 pm
Viewing 15 posts - 3,241 through 3,255 (of 59,098 total)