Viewing 15 posts - 676 through 690 (of 13,838 total)
We can't even properly see your query! How is anyone supposed to know what code is in that function?
December 19, 2023 at 5:11 pm
It's varchar(15). Casting as varchar(max) was the seemingly only way to avoid this error:
"STRING_AGG aggregation result exceeded the limit of 8000 bytes. Use LOB types to avoid result truncation."
After...
December 19, 2023 at 3:32 pm
What is the datatype of SERVICE_CD? CASTing every element to VARCHAR(MAX) sounds like madness.
December 19, 2023 at 3:25 pm
Your DISTINCT is applied to the result of the STRING_AGG, not to the elements it contains.
Remove the dupes in a CTE and select your STRING_AGG from that.
December 19, 2023 at 3:22 pm
Thank you all for the help! Phil's suggestion worked for me, I was trying to avoid it as there is no leading index on the date columns.
I as well...
December 18, 2023 at 2:35 pm
I don't see why there should be a cast-iron association between tableAID and LastUpdateDateTime, assuming that any row, old or new, can be updated (and thus have its LastUpdateDateTime modified).
Instead,...
December 18, 2023 at 1:38 pm
While this is an interesting technique, I'd suggest that the C# script could easily be modified to do the actual copy/move, obviating the need for a Foreach loop. This would,...
December 18, 2023 at 9:00 am
Something like this, perhaps.
PrevSickBalance = LAG(Accrue_Sick_Balance,1,0) OVER (Partition By Employee_ID ORDER BY Payroll_Detail_ID)
December 14, 2023 at 5:48 pm
How about providing your sample data in consumable format, along with your desired results? You've been here long enough to know better
December 13, 2023 at 2:12 pm
That's a huge chunk of code and, in my opinion, asking such general questions is the sort of thing you'd employ a paid consultant to help with.
If you take the...
December 12, 2023 at 6:21 pm
In the one that doesn't work, I suspect it's because the TOP (1) is being applied before the join on StaffId.
If you were to push the StaffId into the subqueries...
December 12, 2023 at 3:22 pm
I just need to work out how to do this all dynamically, as the column Names and amount of columns can vary in the JSON.
Then you will need to...
December 12, 2023 at 10:27 am
You appear to be asking us to do your assignment for you, am I right? That table structure does not exist in the real world
December 12, 2023 at 9:21 am
My thoughts are that any password columns should be encrypted. No need to worry about DENY permissions if you do that.
December 11, 2023 at 4:01 pm
This is not an easy format to achieve what you want, because the array items are not linked to each other.
But if you were to add a key to the...
December 11, 2023 at 3:16 pm
Viewing 15 posts - 676 through 690 (of 13,838 total)