Viewing 15 posts - 1,246 through 1,260 (of 7,614 total)
Create the temp table before calling the proc. Have a flag that is passed in to "tell" the proc to load its results into the temp table, or you could...
September 28, 2021 at 3:34 am
sql playing dumb on this case
if your software can be set to do other types of joins/cross applies or even to, as you said, generate the isnull (which works...
September 27, 2021 at 3:20 pm
Not one of these are valid date/datetime values:
'Sep 01', '2001-Q3', '2001-Q2', 'Sep 01', '2001-Q3', '2001-Q2'
September 26, 2021 at 10:22 pm
Whoever's teaching your class is not particularly expert at db design. Storing NNN-NNN-NNN is just plain wrong; it's a waste of space to store fixed dashes in a column.
September 26, 2021 at 10:17 pm
Gotta say this, since it's a pet peeve of mine = Using comments in place of accurate names.
Viz, why?:
FROM Tally t --Month count sequence starting at 0
rather than:
FROM Tally month_count...
September 24, 2021 at 7:43 pm
Hi Scott,
like I mentioned earlier, the WHERE clause is added afterwards in my application (so the user can choose to see archived corporations only, active corporations only or both)....
September 24, 2021 at 7:39 pm
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
Viewing 15 posts - 1,246 through 1,260 (of 7,614 total)