Viewing 15 posts - 2,221 through 2,235 (of 7,608 total)
I think should be pretty accurate, at least without going to a lot more trouble to write. Yes, it uses recursion, because we need to find every JOIN. If somehow...
October 20, 2020 at 9:24 pm
When using NOT IN, you should make sure a NULL value does not appear in the results. For example, like below. Try that first and see if it cleans up...
October 19, 2020 at 5:25 pm
SELECT T1.DocumentNo, T2.LongSentence
FROM Table2 T2
INNER JOIN Table1 T1 ON T2.LongSentence LIKE '%' + T1.DocumentNo + '%'
October 19, 2020 at 5:17 pm
Yes, yes and yes, as long as the proc not being EXEC'd by each other.
That is, this should work fine:
--ok
EXEC sp1
EXEC sp2
EXEC sp3
because SQL will clear temp tables created within...
October 18, 2020 at 6:35 am
Here's my version, also no recursion, with added alias names for more clarity:
SELECT
start_date, end_date,
full_weeks * 2 +
...
October 16, 2020 at 1:49 pm
Sorry to the OP for this bit of a side issue.
As noted by others, there's no easy, sure way to know which tables are / aren't being used. Periodically capturing...
October 16, 2020 at 1:16 pm
Since it's based on name, I just exclude tables that start with 'tmp_', 'temp_', 'work_' or 'wk_'. Seems just as easy as excluding schemas to me. And I don't have...
October 16, 2020 at 1:15 pm
I don't use separate schemas (nor would I personally recommend it, given the general hassle of it -- different approaches for different folks). How does one resolve it when the...
October 15, 2020 at 9:37 pm
Again, as I stated, it took only 1 more byte to store YYYY vs YY. Dates were stored as numeric and not char, also to save space. YYMMDD...
October 15, 2020 at 3:33 pm
OK, if you set the fillfactor to 51 and rebuild you will have far fewer splits, perhaps none, because you've already at least doubled the size of the table. Any...
October 15, 2020 at 2:57 am
You should be able to in this case because whether the called proc inserts into a table or returns the result set directly will be controlled by a new parameter...
October 14, 2020 at 9:41 pm
You're very welcome.
It would help everyone if you marked it as the "Answer". That way future readers know it's been resolved and they don't need to spend time on it...
October 14, 2020 at 7:52 pm
It is very possible you need both indexes. However, developers typically don't really know. You need to check the index usage stats, as Anthony stated, to know for sure.
While you're...
October 14, 2020 at 6:22 pm
1. If the varchar columns repeat values frequently, encode the varchar(50) columns as ints, using a separate encoding/lookup table. This would be, by far, the biggest performance improvement.
2. Page compress...
October 14, 2020 at 6:18 pm
There's almost always an alternative in coding. If you don't want the CROSS APPLY, you can replace "dash_2" everywhere it appears in the SELECT with "CHARINDEX('-', string, PATINDEX('%-----%', string) +...
October 14, 2020 at 6:05 pm
Viewing 15 posts - 2,221 through 2,235 (of 7,608 total)