How to check the condition
this is my sp
how to check the id is null in the sp
alter PROCEDURE Check_Exist
(
@Id INT,
@balance money
)
AS
BEGIN
If @Id is null
IF NOT EXISTS (SELECT AccountId FROM Account WHERE [AccountId]=@Id)
BEGIN
INSERT INTO Account VALUES(@Id,@balance)
PRINT 'New Record Insert Successfuly'
END
ELSE
BEGIN
PRINT 'Id All Ready Exist'
END
END
please help me this
Pravat KumarRank #2,456 · 573 reputationPosted Aug 22, 2018, 12:07 AM EDT
Sanwar RanwaRank #23 · 44.7K reputationPosted Aug 21, 2018, 11:41 PM EDT
Raja TRank #685 · 3.5K reputationPosted Aug 21, 2018, 11:55 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts