Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

How to have SQL remove matching data?

$
0
0

Every month, I update a variety of files. In the past, I did this through a web interface. However, we have a new shared database and that functionality is not in place yet. This is the concept. There are four tables; laborforce, current employment, current price, and claims. In 3 of the four, there is a field for preliminary. For this prelim field, 1= prelim and 0 = Final. On the web interface, if I import February (prelim = 1) and January (prelim = 0), it deletes my past January 2019 values which were prelim = 1. Prelim is not a primary key.

In SSMS using the import and export wizard, I get a primary key duplication error which is understandable. Prelim is the 9th field if one reads left to right and the first seven are primary keys. Without using SSIS, is there a way to have it remove the past version of a month. The file that I...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>