Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I do this in a stored procedure (multiple cmds)
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Can I do this in a stored procedure (multiple cmds)
Divers
Thread ID:
00833437
Message ID:
00833437
Vues:
41
When a user deletes a master record, I want to delete the children in the children table (coSuper and coSuper2), I don't actually delete them, but change a flag (isactive) from true to false. Just wondering if this is ok in a stored procedure:
CREATE PROCEDURE ct_DelPrefCard
@tiCardID int

as
SET NOCOUNT ON
begin
--Delete the actual card
Update coSuper set isActive=0 where coSuperID=@tiCardID

--Delete the child records
Update coSuper2 set isActive=0 where coSuperID=@tiCardID

--Delete our linked listed items in the coCardAssign table
--delete from coCardAssign where coSuperID = @tiCardID

set nocount off

end
Thanks
Kirk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform