I have the following. I have a table called Customer that has the following data for example:
CustId CustDate CustOrdAmount CustGrpAmount
1 9/2/2014 1000.00 900.00
1 10/1/2014 800.00 800.00
1 11/2/2014 900.00 100.00
2 8/4/2014 990.00 990.00
2 9/5/2014 700.00 800.00
I then have another temp table I will create that will have the following:
What I need to do is check based on the CustId if the temp table CustOrdAmount delta is different OR the CustGrpAmount is different than the Max(CustDate) record in Customer for that CustId then Insert a new record into the Customer Table otherwise ignore the insert from the Temp table to the Customer table for that CustId.
So in this case above I would be comparing the 3rd record in Customer table CustId = 1 to the TempTable CustId = 1 and inserting a record into the Customer table. For CustId = 2 I would be ignoring that insert they are the same both columns.
Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied?
You can use SQL Server Initialize from Backup…