Sqlserver
 sql >> Datenbank >  >> RDS >> Sqlserver

SQL und mehrere Anweisungen in einer gespeicherten Prozedur

IF  EXISTS (SELECT ID, code FROM tblTabel WHERE ID = @ID and code = @Code) 
BEGIN
    UPDATE tblTabel SET ID = @ID,code = @Code WHERE ID = @ID
    UPDATE tblTabelB SET ID = @ID,code = @Code WHERE ID = @ID
    UPDATE tblTabelC SET ID = @ID,code = @Code WHERE ID = @ID
END