Viewing 15 posts - 181 through 195 (of 6,678 total)
I am going to take a little different approach - the CTE should define the detail data and then we can summarize that detail data. There really isn't any need...
October 7, 2023 at 2:51 pm
Here are some recommendations:
October 6, 2023 at 7:33 pm
Thanks Jeffery
Yeah we contacted the vendor who said they feel the issue is permission related.
The error is not occurring in that code - or it is happening somewhere later...
October 4, 2023 at 6:03 pm
SELECT aging_1_30 = SUM(CASE WHEN st.HowManyDays <= 30 THEN st.thisAmt END)
, aging_31_60 = SUM(CASE WHEN st.HowManyDays > 30 AND st.HowManyDays <=...
October 3, 2023 at 8:54 pm
Thanks Jeffrey. Other thing I was looking for indexing and also to remove the UPPER() function. This database is not case-sentive database. I am not sure, why they are...
October 3, 2023 at 8:47 pm
If the dev is stating they only want the latest 30 minutes of data - then the code is wrong. That code is pulling all of the data except the...
October 3, 2023 at 8:36 pm
You need to put a ticket into Optum/Ingenix - most likely you have a version issue between the database and application.
With that said, the error you are getting references an...
October 3, 2023 at 8:32 pm
Also, if you really are using RCSI, then using (NOLOCK) is a complete waste of code realestate. Also, using (NOLOCK) by itself was deprecated years ago. MS says the...
October 2, 2023 at 7:01 pm
A bit confusing - you state it runs quickly in 5-10 minutes (not quick in my opinion) - then later on say it takes 4 seconds. Either way, the first...
October 1, 2023 at 4:14 pm
By copying all rows and all columns into a temp table - you remove any possibility of utilizing indexes on the source table. So every time you query that temp...
October 1, 2023 at 3:33 pm
I just remember the ones I use the most - and CHAR(39) is one of those. For all others: https://www.asciitable.com/
September 27, 2023 at 5:53 pm
SELECT STRING_AGG(QUOTENAME(td.[name], ''''), ',')
FROM #tbl_db AS td;
I prefer using CHAR instead of multiple single-quotes:
SELECT STRING_AGG(QUOTENAME(td.[name], CHAR(39)), ',')
FROM #tbl_db AS td;
September 26, 2023 at 8:37 pm
Why are you selecting everything into a temp table? You should filter that down to just the columns you need - and only the rows that are needed.
September 25, 2023 at 9:19 pm
For a running total - you can use: thisBalance = SUM(thisAmt) OVER(PARTITION BY Batch_Id ORDER BY Id)
If you want to break out the totals even further, add those to the...
September 17, 2023 at 2:39 pm
There are a couple of options:
September 16, 2023 at 5:19 pm
Viewing 15 posts - 181 through 195 (of 6,678 total)