0

I am trying to update the table based on the values passed. I need to check if the same row exists in the table. If it doesn't exist then insert the values into table. If exists the update the particular row of table.

Currently I have written the stored proc to directly enter the values. Any help?

Create proc [dbo].[SaveBudgetDetails]
@Quarter nchar(10),
@Year int,
@LineID nvarchar(MAX),
@Project nvarchar(MAX),
@Budget decimal(18,0)
AS
BEGIN

     INSERT INTO [dbo].[BudgetDetails]
           ([Quarter]      
           ,[Year]
          ,[LineID]
          ,[Project]
          ,[Budget])

     VALUES
           ( @Quarter,@Year,@LineID,@Project,@Budget)

END
beginner
  • 303
  • 1
  • 10
  • 31

0 Answers0