Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Bulk update/insert table with Stored Procedure

$
0
0

I have 2 tables in SQL server

Table 1 has several columns. One of these columns is Ticketnr (Primairy Key)

Table2 has several columns. One of these columns is Ticketnr (No key)

I woiuld like to update/insert Table1 with records from Table2 with a stored procedure, that can be started with an SQL job e.g. every hour.

This stored procedure should update all records in Table1 if the Ticketnr from Table2 already exists in Table1 and should insert all records in Table 1 from Table2 if Ticketnr from Table2 does not exist in Table1.

I hope someone can help me?

Kind regards

Jim de la Combe


Jim de la Combe freelance VBA developer




Viewing all articles
Browse latest Browse all 7129

Trending Articles



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