Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Oracle - MS Server / 8 / procDel

.txt
Скачиваний:
20
Добавлен:
17.04.2018
Размер:
1.18 Кб
Скачать
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Prishutova Ekaterina
-- Create date: 15.06.16
-- Description: удаление строк из таблицы Operation
-- =============================================
CREATE PROCEDURE procDel
-- Add the parameters for the stored procedure here
@Id int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
UPDATE dbo.Student SET NORR=NORR - 1 WHERE dbo.Student.StudId = (SELECT dbo.Operation.StudId FROM dbo.Operation WHERE dbo.Operation.StudId = @Id)
SET NOCOUNT ON;
DELETE FROM dbo.Operation WHERE dbo.Operation.StudId = @Id;
END
GO


__________________________


EXECUTE procDel 5;
GO
Соседние файлы в папке 8