I have the following pseudo code and want to know if I am going about it properly. The background is I have a table that has ~138 million rows in it and I want to aggregate certain certain columns by some set of grouping variables. I want to do this on the [Timestamp] column which represents a snapshot date. There are roughly 4 million rows per snapshot.
Loop through column value and insert into another table
I have the following pseudo code and want to know if I am going about it properly. The background is I have a table that has ~138 million rows in it and I want to aggregate certain certain columns by some set of grouping variables. I want to do this on the [Timestamp] column which represents a snapshot date. There are roughly 4 million rows per snapshot.
I am trying to use case to set a parameter in my where clause
I have a file that intakes yearly totals for tax due and breaks it down by month like : fcurJanuaryTotal, fcurFebruaryTotal, fcurMarchTotal etc. When someone receives a notice to pay taxes on a given month I receive a ‘lead’ which sets the pay period in this format dd-mm-yyyy (in a column named ‘fdtmFilingPeriod’). I have a program that uses a query to create the lead and then create an estimated payment for their taxes and pulls the financials from the file I receive with the monthly totals. It is desired that no estimated payments be created that are less than $100.
Every time I drop a database, I have to manually kill the spid or I get an error: Cannot drop database currently in use
There’s a common error called:
Possible Permanent Join
I am trying to check to see if the file name (Radiology_PaidClaimAudit_Member_Count_20240129.txt) in #temp2 is like one of the file names in the Insertinto lines in the code below. It works great on the “dm_Caresrc” schema, because it is only returning the 2 that are missing enter image description here
SQL Server – subtracting a column value from the same column but a previous date
Main problem – i need to subtract a previous pay period total of Column A from a current pay period total column A.
All of a sudden not working, using linked server to source getting “Communication link failure”
These jobs were working then all of a sudden all jobs connecting to source server are getting “Communication link failure”. [SQLSTATE 01000] (Error 7412) OLE DB provider “SQLNCLI11” for linked server . We have tried same from another server to the source server and getting the same error. We can see the linked server and the db and tables etc.
Allocation for rows
I have two tables lets say #table1 and #table2 . Table1 has 282 rows and for columns column1,column2 , column3 and column4(modulo)key.
Table2 has two columns, column1 , which has 8 rows containing agent1 to agent8 , and modulo 1 to 8.
How to do looping in SQL Server
I have source table named, tbl_account