Viewing 15 posts - 46 through 60 (of 2,462 total)
Good one Steve!
-- Itzik Ben-Gan 2001
October 25, 2019 at 8:49 pm
a great start - I use rownumber over (partition by order by) a lot
one of the more overlooked windowing fuctions though is NTILE - especially when you are dealing...
-- Itzik Ben-Gan 2001
October 22, 2019 at 2:43 pm
Absolutely brilliant! I love this article. Well done. Five stars.
-- Itzik Ben-Gan 2001
October 17, 2019 at 2:12 pm
You would probably want to create a calendar table when you also want to exclude bank and national holidays since those can vary by country, company and...
-- Itzik Ben-Gan 2001
October 3, 2019 at 6:52 pm
That function looks like a horror movie and it's not even Halloween yet. The function below, ifn_workdays, is what you need. It does not handle holidays. Here's an example and...
-- Itzik Ben-Gan 2001
October 3, 2019 at 5:32 pm
It would be cool if there were a WITHOUT keyword.
...
FROM <table> WITHOUT (INDEX(<index(s) you dont want to use>))
-- Itzik Ben-Gan 2001
October 3, 2019 at 3:03 pm
Redgate SQL Prompt is useful for this kind of thing. It's not as intuitive as you would describe but it will help you identify unused variables, parameters and columns, which...
-- Itzik Ben-Gan 2001
September 17, 2019 at 11:13 pm
And thanks to your lack of netiquette, we have no DDL.
I think what I posted should answer the OP's question as well as yours Joe.
-- Itzik Ben-Gan 2001
September 16, 2019 at 7:01 pm
You can use TOP and ORDER BY NEWID() like this:
-- Sample data
DECLARE @yourdata TABLE
(
Family INT,
Room INT,
subfamily INT
);
INSERT @yourdata VALUES (1,5,6),(2,5,7),(3,5,7),(4,2,3),(4,2,4);
-- Number of Rows
DECLARE @rows INT...
-- Itzik Ben-Gan 2001
September 16, 2019 at 4:19 pm
. This particular article, well I regret reading and discussing it. Yet again, SSC disappoints.
I would ask for your money back.
-- Itzik Ben-Gan 2001
September 12, 2019 at 5:37 pm
As already mentioned - you don't want to pass other people's experience off as your own. I would never hire someone who did this nor would I respect someone who...
-- Itzik Ben-Gan 2001
September 10, 2019 at 8:47 pm
"UK to stay in Interrail scheme after U-turn"
ba dum chhh
-- Itzik Ben-Gan 2001
August 8, 2019 at 9:42 pm
Speedy Pletcher beat me to it... More details about the requirement are in order. Here's my solution:
DECLARE @startDate DATE = '20181230', @endDate DATE = '20191230';
WITH
E1 AS...
-- Itzik Ben-Gan 2001
July 30, 2019 at 5:26 pm
PatExclude or PatReplace can do the trick.
For example, this will remove any characters that are not alphanumeric while preserving spaces (note the space after the "Z"):
"I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."-- Itzik Ben-Gan 2001
July 22, 2019 at 9:59 pm
Old thread, I know but there is something that has not been discussed here that I think is super important. Correctly designed CLR scalar UDFs don't have the problems that...
-- Itzik Ben-Gan 2001
July 22, 2019 at 9:39 pm
Viewing 15 posts - 46 through 60 (of 2,462 total)