Hi, I have two tables that are of the same structure, the only difference is one is the main table and the other one stores the input from the application. I want to use the main table as a reference in my query in order to help my application. Table 1 (Main Table)(dbo.MainMaster): User ID Price2 5401 62.002 6921 61.002 2215 49.003 3210 89.003 2425 99.00Table 2 (Used By Application)(dbo.PriceTest):User ID Price2 5401 60.002 6921 61.552 2215 49.003 3210 91.003 2425 99.00What I am trying to achieve is IF a record exists in Table 2 for the specific user on the same ID with the same price then to update the Price in column in Table 2 with the price for that ID and User in Table 1. I am not sure if I go the Update route or the select into route. But so Table 2 is getting populated through the following stored procedure that I want to modify in order to reference Table 1. set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgoALTER PROCEDURE [dbo].[AppInsert] @User int ,@ID int ,@price moneyAS DELETE FROM dbo.PriceTest WHERE User = @User AND ID = @ID INSERT INTO dbo.PriceTest VALUES(@User,@ID,@price)
Any help will be appreciatedThanks