Viewing 15 posts - 1,786 through 1,800 (of 6,679 total)
Sorry - since I don't have those tables or any sample data I wasn't able to validate the code. I missed the closing parenthesis on the sum...
SELECT...
June 8, 2020 at 10:28 pm
I would probably look at downloading the text file and uploading the data into table(s) in a reference database. I could then join to the table(s) to get the values...
June 8, 2020 at 10:20 pm
A part of the problem is doing the rounding inside the sum. I recommend that the rounding be done on the sum rather than inside it for both reasons...
June 8, 2020 at 10:09 pm
Yes - you need to group the results. A couple of notes:
June 8, 2020 at 9:49 pm
Since you are on 2016 and you don't have access to STRING_AGG, you can still use FOR XML.
Select Distinct
...
June 8, 2020 at 9:02 pm
Here is what I was thinking - not tested and may need some refinement in the build of the temp tables. This all depends on how many rows can satisfy...
June 7, 2020 at 4:54 pm
For the creation of the #Entity temp table.
I would move the join to Industry into the build of the #EntityIndustry table - and then move the join to #EntityIndustry into...
June 6, 2020 at 10:32 pm
Is there more to this code than you have shown? I see several temp tables that are created - and never used. I also see an outer join to a...
June 6, 2020 at 4:33 pm
I have no idea why Microsoft has kept that option in the product - auto shrink will cause massive fragmentation of the database every time it shrinks. It...
June 6, 2020 at 4:12 pm
Just to confirm, COALESCE won't provide an improvement in performance over CASE, although it will make the code a whole lot easier. Behind the scenes, the optimizer converts a...
June 6, 2020 at 3:40 pm
One other optimization that *may* be possible is to remove the CASE expression. I have to assume that if a match is found in #entity that the columns from that...
June 6, 2020 at 3:07 pm
I have no idea why Microsoft has kept that option in the product - auto shrink will cause massive fragmentation of the database every time it shrinks. It is just...
June 6, 2020 at 2:44 pm
After going down that rabbit hole, I stumbled on a way to at least start the service by bypassing the upgrade script. Once I was able to start MSSQLSERVER...
June 6, 2020 at 2:38 pm
You can avoid errors where there are missing periods by making sure you always have 4 periods in the field. Here is one approach:
Select *
...
June 5, 2020 at 5:07 pm
Viewing 15 posts - 1,786 through 1,800 (of 6,679 total)