Viewing 15 posts - 676 through 690 (of 13,841 total)
What is the text of the error you are receiving?
Is the data exactly the same across the different environments?
December 27, 2023 at 4:55 pm
You need to find out more from the person asking you to do this. Questions such as
What sort of validation? Data within certain limits? Data has only predefined values? Data...
December 24, 2023 at 10:05 pm
Wow, don't be offended, but what a mess! It might be time to think about a divide and conquer approach. Build up your result sets individually and then assemble them...
December 19, 2023 at 8:30 pm
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
Viewing 15 posts - 676 through 690 (of 13,841 total)