Viewing 15 posts - 166 through 180 (of 1,419 total)
I actually set the table option to have "large data types (LOBs)" be stored "out of row" (to prevent "trapped short rows" and other page density issues), which is...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 14, 2023 at 9:56 pm
Bump. Maybe the prior posting was never visible
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 14, 2023 at 6:26 pm
Error severity 20-25 are system errors so I wouldn't want to turn off logging and consider that the solution :). There's a packet size system setting for which there's a...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 14, 2023 at 3:32 pm
I can request that to happen, if it achieves the end result and can simplify the process. Its something we can work towards.
If I go down this path, I'll...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 14, 2023 at 2:03 pm
TBH, I don't see why the people making the JSON can't make it into a table and populate the table directly. They even provide a datatype key and they...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 14, 2023 at 1:43 pm
Understand that I was speaking only from the SQL Server side... there is no "looping" required to pivot the JSON into a table.
While were on the subject, I wouldn't...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 14, 2023 at 1:25 pm
The JSON will always have the same values/pairs as that part is static.
That pairing is still not 100% as I'm taking suggestions provided by Phil/Steves to help improve the...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 13, 2023 at 9:11 pm
An alternative
select v1.CompanyName,
left(v1.CompanyName, sum(iif(ss.ordinal<=1, v.str_len, 0))) _1_word,
left(v1.CompanyName, sum(iif(ss.ordinal<=2, v.str_len, 0))+1) _2_word,
...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 13, 2023 at 1:41 pm
This mostly borrows your FROM clause except I changed DaysToAdd to be 'int' which the JSON supports (it's not in quotations). Instead of PIVOT I always use conditional aggregation. It's...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 12, 2023 at 12:03 am
100% agree with Phil. Fix the JSON please 🙂 To save myself from toil I used ChatGPT-4 and here's the result
You're right, embedding SQL code in JSON is not a...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 11, 2023 at 5:47 pm
If you want the odd numbered 'rotation' column value(d) rows to be updated from the even numbered rows then LAG would seem the better choice. First tho, I agree with...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
December 5, 2023 at 1:26 pm
Maybe something like this. The OUTER APPLY looks for the next occurrence of [Status] in('collected', 'shipper') for each dropoff and preparation. Also, LEAD(DateShipped) looks for the next occurrence of [Status]...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
November 30, 2023 at 5:42 pm
Maybe get rid of the MAX OVER and just evaluate the Status column
select *, iif([Status] in('Dropoff', 'preparation'), 1, 0) d_or_p
from #ShipperStatusHistory
order by OrderNumber, DateShipper;Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
November 30, 2023 at 2:48 am
Plural. Each row is a singular instance
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
November 28, 2023 at 5:22 pm
Happy Thanksgiving
Based on the written requirements (as interpreted) this query might be helpful. The comparisons being made across rows are partitioned by (OrderNumber, RelayPoint) and ordered by DateShipper. To identify...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
November 25, 2023 at 2:23 am
Viewing 15 posts - 166 through 180 (of 1,419 total)