update db project

This commit is contained in:
Andreas Zweili 2017-11-29 21:12:35 +01:00
parent 035e48110c
commit 380d2cdd68
2 changed files with 68 additions and 0 deletions

View File

@ -49,6 +49,12 @@
<AssociatedConnUserName />
<FullPath>TSQL-StoredProcedures-Aufgaben_Loesungen.sql</FullPath>
</FileNode>
<FileNode Name="TSQL-Triggers-Aufgaben_Loesungen.sql">
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local)\SQLEXPRESS:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName>(local)\SQLEXPRESS</AssociatedConnSrvName>
<AssociatedConnUserName />
<FullPath>TSQL-Triggers-Aufgaben_Loesungen.sql</FullPath>
</FileNode>
</Items>
</LogicalFolder>
<LogicalFolder Name="Miscellaneous" Type="3" Sorted="true">

View File

@ -0,0 +1,62 @@
-- ================================================
-- Template generated from Template Explorer using:
-- Create Trigger (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- See additional Create Trigger templates for more
-- examples of different Trigger statements.
--
-- This block of comments will not be included in
-- the definition of the function.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Andreas Zweili
-- Create date: 2017-11-24
-- Description: Trigger Beispiel
-- =============================================
ALTER TRIGGER dbo.trigArztUpdate
ON dbo.Arzt
AFTER UPDATE
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
print 'update trigger ausgeführt.';
select * from inserted;
select * from deleted;
-- Insert statements for trigger here
END
GO
-- =============================================
-- Author: Zweili Andreas
-- Create date: 2017-11-24
-- Description: INSTEAD-OF Beispiel
-- =============================================
CREATE TRIGGER dbo.trigArztInsteadDelete
ON dbo.Arzt
INSTEAD OF DELETE
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for trigger here
print 'Instead of Delete Trigger';
END
GO
-- Trigger Test
delete from Arzt where ArztName = 'Hektor';