Viewing 15 posts - 4,561 through 4,575 (of 59,067 total)
September 24, 2021 at 10:34 pm
So I have a new interview question. 😀
Given the following output:
And the following code that produced the output:
I agree that a "Best Practice" to prevent recompiles would be to move the creation of the temp tables to the very beginning but that's not likely to make a...
September 24, 2021 at 6:49 pm
p.s. I hate the double spacing this forum does with code. It makes even well formatted code look like junk.
September 24, 2021 at 6:37 pm
Over the years, and especially this last 18 months, it seems like the problem of calculating the Nth Occurrence of some weekday has come up over and over. It always...
September 24, 2021 at 6:34 pm
I tested it with a couple of different DATEFIRST settings. It appears to work correctly now.
September 24, 2021 at 6:16 pm
Thank you very much for the valuable feedback. So does my suggestion to add more data files to TempDb sound reasonable then?
To me... no. Even if you do that...
September 24, 2021 at 2:34 pm
Ya know... the very least you could do is run that code through a decent formatter to get proper indentation the help with readability.
While I'm sure it's not the whole...
September 24, 2021 at 2:30 pm
I've amended your code. I think this should be a few times faster as it removes the need for a tally of 7 week days and just calculates...
September 24, 2021 at 12:57 pm
Heh... one good test result is worth a thousand expert opinions. 😀
September 24, 2021 at 6:18 am
Ok. So what in the code uniquely identifies that code and ONLY that code? Which DB_ID does it run against? What is the USER_ID the code from the front...
September 24, 2021 at 12:06 am
Sure, it's above; I posted it years ago, when this q was first asked.
Actually I should adjust it again, you only need to calc the very first Friday, from...
September 23, 2021 at 10:25 pm
Is it a stored procedure or ad hoc code or ???
September 23, 2021 at 8:35 pm
September 23, 2021 at 6:38 pm
Welp then start adding columns one by one until it breaks 🙂
Good lesson on basic troubleshooting. Sorry I almost screwed that all up with my post about desk checking.
September 23, 2021 at 5:32 pm
Viewing 15 posts - 4,561 through 4,575 (of 59,067 total)