Viewing 15 posts - 1 through 15 (of 288 total)
Maybe something like this?
declare @Teams table (
TeamCode varchar(10),
Description varchar(30)
)
INSERT INTO @Teams (TeamCode, Description)
...
Wow that seems very fast...
I'm not sure why some of this code exists and its logic wasn't up front when developed
Much appreciated for your reply.
Thanks, but... on second thought...
... also, why do you group by d.attValue when you have a MAX() on that column in the SELECT?
I find it curious that you use so many self-joins only to do some sums. I would probably move the additional criteria from the WHERE section to CASE statements in...
Might be a driver issue. Are you using an OLEDB driver or something else? 32 bit or 64 bit?
Michael J. Swart has a nice write-up about different kinds of upserts (and what's good and what's not):
https://michaeljswart.com/2017/07/sql-server-upsert-patterns-and-antipatterns/
Viewing 15 posts - 1 through 15 (of 288 total)