Viewing 15 posts - 1,246 through 1,260 (of 7,608 total)
Yeah, you can test for NULLs in columns and/or GROUPING_ID to determine: which rows are total rows and which rows are detail rows; to exclude total rows you don't want;...
September 24, 2021 at 6:09 pm
Actually, if you want to comprehensively review the indexes on those table, run this script twice (once for 'Corporation%' tables and once for 'Entity%' tables) and post both result sets...
September 24, 2021 at 6:03 pm
You should be able to script this out. Make sure the "Script indexes" option is on. Then Script the table; that should give you DDL for the table and all...
September 24, 2021 at 5:57 pm
OK. You said "instead of" so I figured you didn't want the other details in the new query.
Maybe try:
GROUP BY entity,groupname,description,effdate WITH ROLLUP
You can get rid of total lines you...
September 24, 2021 at 5:55 pm
Not 100% sure what you need, but probably:
SELECT entity
,description
,[Total] =...
September 24, 2021 at 5:32 pm
Do you have an index on:
CorporationHistory ( CorporationID, EffectiveDate )?
If not, you need one.
I specialize in tuning SQL Server. It's easy to overlook indexes if you don't have a lot...
September 24, 2021 at 5:23 pm
I'd be real careful with that. It uses the WEEKDAY date part, which is subject to change and most recommend not using it for such calculations. I...
September 24, 2021 at 4:04 pm
Create all temp tables separately from loading them. Bonus: you could then also properly cluster the temp tables before loading them.
The direct load of table with SELECT ... INTO #temp...
September 24, 2021 at 3:49 pm
#5 is completely wrong approach. You should never use ISNULL() in a WHERE clause. Instead move the condition from the WHERE clause to the LEFT JOIN. You need to that...
September 24, 2021 at 3:27 pm
... All required indexed are defined ...
Can't just take your word for that, still need to see DDL for the tables, including all index definitions.
September 24, 2021 at 2:58 pm
You ran a comparison?
Would we need to? A single math calc vs iterating thru string generations and comparisons?
September 24, 2021 at 4:11 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,...
September 23, 2021 at 10:29 pm
Just out of curiosity, what is the recovery model on the model db?
I'm wondering if the db got created then restored over ?!
September 22, 2021 at 9:50 pm
You don't need to iterate/loop thru values looking for 'Tuesday', and personally I wouldn't. I find all such code much harder to adjust later, and generally less efficient.
I guess you...
September 22, 2021 at 8:30 pm
Viewing 15 posts - 1,246 through 1,260 (of 7,608 total)