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 KumarPosted Aug 22, 2018, 4:07 AM
Raja TPosted Aug 22, 2018, 3:55 AM
Sanwar RanwaPosted Aug 22, 2018, 3:41 AM