spAddUpdate_ProfessionCodes
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PKID | int | INOUT | |
@Code | nvarchar(4) | IN | |
@Profession | nvarchar(510) | IN |
Definition
Copy
CREATE PROCEDURE dbo.spAddUpdate_ProfessionCodes
(
@PKID int output ,
@Code nvarchar(4) ,
@Profession nvarchar(510)
)
AS
begin transaction
if (@PKID<=0)
begin
INSERT INTO ProfessionCodes
(
Code ,
Profession
)
VALUES
(
@Code ,
@Profession
)
SELECT @PKID = @@Identity
end
else
begin
UPDATE ProfessionCodes SET
Code =@Code ,
Profession =@Profession
WHERE ID=@PKID
end
commit transaction