diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite
new file mode 100644
index 0000000..ffc3cf3
Binary files /dev/null and b/.vs/slnx.sqlite differ
diff --git a/README.md b/README.md
index f3067ed..1bc92bd 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,21 @@
 # SQL_Server
 
-###### Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which may run either on the same computer or on another computer across a network.
+## Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which may run either on the same computer or on another computer across a network.
 
 ### [Stored Procedures](https://github.com/Burakkylmz/SQL_Server/tree/master/Stored_Procedures)
 
 Most of the popular relational database systems, SQL Server, Oracle, MySQL and the like, support stored procedures. A stored procedure is nothing more than a piece of code that performs some repetitive set of actions. It performs a particular task by executing a set of actions or queries against the database. The code for the stored procedure is stored in the database and can be executed at any time. Stored procedures are typically used to insert your records into one of more tables, update or delete data from tables, and to generate reports via the SELECT statement. It's actually possible for a stored procedure to do more than one thing. 
 
 > If you want to try the stored procedure examples, first run the contactdb.sql scripts under the src folder in SQL Server to create the sample database. 
+
+### [Trigers & Functions](https://github.com/Burakkylmz/Programming_SQL_Server_Database/tree/master/Triger_Functions)
+
+##### What is a DML Trigger?
+
+DML stands for data manipulation language, and it's that vocabulary of standard T-SQL commands that you already know that attempt to retrieve data, modify data, or manipulate it, things like SELECT and INSERT and UPDATE and DELETE.  Data in a relational database is stored within tables, a concept we're used to, and DML triggers watch for data manipulation events.  So inserting, updating, and deleted. 
+
+##### After & Instead of Triggers
+
+Within SQL Server, there are two kinds of triggers, INSTEAD OF and AFTER triggers. In almost every way, they really are the same. The only difference is where and when they do their work, but they're working on the same data. So first, let's review the similarities and then look at their differences.  Both INSTEAD OF and AFTER triggers have access to inserted and deleted data, and both execute within the DML transaction that began this event, so the UPDATE statement, the INSERT statement, whatever that was. The real difference comes in these last two points, which speaks to the difference of when the data is actually passed to the trigger and the responsibility of the trigger to do something with that data. In an AFTER trigger, all the constraints have passed, and the data that's passed to the trigger is already considered good.
+
+
diff --git a/Triger_Functions/DDL.sql b/Triger_Functions/DDL.sql
new file mode 100644
index 0000000..003a44a
--- /dev/null
+++ b/Triger_Functions/DDL.sql
@@ -0,0 +1,116 @@
+Use WideWorldImporters-Pluralsight;
+GO
+
+/*
+  Create a DDL trigger in this current database that prevents
+  altering or dropping a table
+*/
+CREATE OR ALTER TRIGGER TDB_PreventTableDropOrAlter
+ON DATABASE
+FOR DROP_TABLE,ALTER_TABLE
+AS
+BEGIN
+ PRINT 'DROP and ALTER table events are not allowed. Disable trigger TDB_PreventTableDropOrAlter to complete action.'
+ ROLLBACK
+END
+
+/*
+  Attempt to drop our Audit Log table
+*/
+DROP TABLE Application.AuditLog;
+
+/*
+  Attempt to add a column to the Application.Person table
+*/
+ALTER TABLE Application.People ADD TwitterHandle nvarchar(100);
+
+/*
+  Disable the trigger so that we can complete our modification;
+*/
+DISABLE TRIGGER TDB_PreventTableDropOrAlter ON DATABASE;
+
+/*
+  Attempt to add a column to the Application.Person table again
+*/
+ALTER TABLE Application.People ADD TwitterHandle nvarchar(100);
+
+/*
+  Enable the trigger again
+*/
+ENABLE TRIGGER TDB_PreventTableDropOrAlter ON DATABASE;
+GO
+
+
+/*************************************
+*
+* Log DDL Events to a table
+*
+*************************************/
+
+CREATE TABLE Application.AuditLogDDL
+( 
+ Id INT IDENTITY,  
+ EventTime DATETIME,
+ EventType NVARCHAR(100),
+ LoginName NVARCHAR(100),
+ Command NVARCHAR(MAX) 
+)
+GO
+
+/*
+  This will log ALL DDL events at the database level.
+
+  In reality, this should be refined to only capture events
+  on specific types OR this audit table should be aggressively
+  managed to only keep relevant events and table size small.
+*/
+CREATE TRIGGER AuditLogDDLEvents
+ON DATABASE
+FOR DDL_DATABASE_LEVEL_EVENTS
+AS
+BEGIN
+ SET NOCOUNT ON
+ DECLARE @EventData XML = EVENTDATA()
+ INSERT INTO Application.AuditLogDDL(EventTime,EventType,LoginName,Command) 
+ SELECT @EventData.value('(/EVENT_INSTANCE/PostTime)[1]', 'DATETIME'),
+		@EventData.value('(/EVENT_INSTANCE/EventType)[1]', 'VARCHAR(100)'),
+	    @EventData.value('(/EVENT_INSTANCE/LoginName)[1]', 'VARCHAR(100)'),
+		@EventData.value('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]', 'NVARCHAR(MAX)')
+END
+
+
+/*
+  Now, let's perform some DDL Events and see what we get
+*/
+
+/*
+  Attempt to add a column to the Application.Person table
+*/
+ALTER TABLE Application.People ADD InstagramHandle nvarchar(100);
+
+/*
+  Check the Log
+*/
+SELECT * FROM Application.AuditLogDDL;
+
+/*
+  Disable the trigger so that we can complete our modification;
+*/
+DISABLE TRIGGER TDB_PreventTableDropOrAlter ON DATABASE;
+
+/*
+  Attempt to add a column to the Application.Person table again
+*/
+ALTER TABLE Application.People ADD InstagramHandle nvarchar(100);
+
+/*
+  Check the Log
+*/
+SELECT * FROM Application.AuditLogDDL;
+
+
+/*
+  Enable the trigger again
+*/
+ENABLE TRIGGER TDB_PreventTableDropOrAlter ON DATABASE;
+GO
\ No newline at end of file
diff --git a/Triger_Functions/DELETE_AFTER Examples.sql b/Triger_Functions/DELETE_AFTER Examples.sql
new file mode 100644
index 0000000..68f8b44
Binary files /dev/null and b/Triger_Functions/DELETE_AFTER Examples.sql differ
diff --git a/Triger_Functions/INSERT_AFTER.sql b/Triger_Functions/INSERT_AFTER.sql
new file mode 100644
index 0000000..af861c3
Binary files /dev/null and b/Triger_Functions/INSERT_AFTER.sql differ
diff --git a/Triger_Functions/INSERT_INSTEAD_OF.sql b/Triger_Functions/INSERT_INSTEAD_OF.sql
new file mode 100644
index 0000000..b2f2a2c
Binary files /dev/null and b/Triger_Functions/INSERT_INSTEAD_OF.sql differ
diff --git a/Triger_Functions/Local_Authentication_Triggers.sql b/Triger_Functions/Local_Authentication_Triggers.sql
new file mode 100644
index 0000000..3edb822
--- /dev/null
+++ b/Triger_Functions/Local_Authentication_Triggers.sql
@@ -0,0 +1,152 @@
+USE master;  
+GO
+
+/*
+  Create a new local login to test LOGON Triggers.
+
+  ONLY do something like this in a local, non-shared environment!
+*/
+CREATE LOGIN login_test WITH PASSWORD = 'abc123!'; 
+GO  
+
+/*
+  Grant them access to see DMVs. There are many better ways to
+  accomplish this in production, but this will work for the demo.
+*/
+GRANT VIEW SERVER STATE TO login_test;  
+GO  
+
+/*
+  Create a LOGON trigger that will limit the number of connections
+  for this specific user. They cannot open more than 2 connections.
+*/
+CREATE OR ALTER TRIGGER LimitConnectionsForUser  
+ON ALL SERVER  
+FOR LOGON  
+AS  
+BEGIN  
+IF ORIGINAL_LOGIN()= 'login_test' AND  
+    (SELECT COUNT(*) FROM sys.dm_exec_sessions  
+            WHERE is_user_process = 1 AND  
+                original_login_name = 'login_test') > 2
+    ROLLBACK;  
+END;  
+
+
+
+
+
+/***********************************************
+ *
+ * Create a server-level audit logging database
+ *
+ **********************************************/ 
+
+/*
+  Create an Audit Log Database for server-level events. This
+  will be owned by my local user for now.
+*/
+CREATE DATABASE AuditLogDB;
+GO
+
+USE AuditLogDB;
+GO
+
+/*
+  Create a table within the new database to store login event data
+*/
+CREATE TABLE LogonEventData
+(
+    LogonTime datetime,
+    SPID int,
+    HostName nvarchar(50),
+	AppName nvarchar(100),
+    LoginName nvarchar(50),
+    ClientHost nvarchar(50)
+);
+GO
+
+/*
+  Create a second LOGON Trigger to log information.
+
+  This will be executed each time as the owner of the logging
+  database. Without this, the Trigger would be executed as the
+  CALLER ('test_login' in this case) and it would return an error
+  because they do not have permission to write into that
+  database.
+
+  Much care and thought should be given to how permissions are 
+  used within your environments to protect data and users
+  appropriately.
+*/
+CREATE OR ALTER TRIGGER SuccessfulLogonAudit
+ON ALL SERVER WITH EXECUTE AS 'RYANB-DEV\Ryan' 
+FOR LOGON
+AS
+BEGIN
+    DECLARE @LogonTriggerData xml,
+        @EventTime datetime,
+        @SPID int,
+		@LoginName nvarchar(50),
+        @ClientHost nvarchar(50),
+        @LoginType nvarchar(50),
+        @HostName nvarchar(50),
+        @AppName nvarchar(100);
+     
+    SET @LogonTriggerData = EventData();
+     
+    SET @EventTime = @LogonTriggerData.value('(/EVENT_INSTANCE/PostTime)[1]', 'datetime');
+	SET @SPID = @LogonTriggerData.value('(/EVENT_INSTANCE/SPID)[1]', 'int');
+    SET @LoginName = @LogonTriggerData.value('(/EVENT_INSTANCE/LoginName)[1]', 'nvarchar(50)');
+    SET @ClientHost = @LogonTriggerData.value('(/EVENT_INSTANCE/ClientHost)[1]', 'nvarchar(50)');
+    SET @HostName = HOST_NAME();
+    SET @AppName = APP_NAME();
+     
+    INSERT INTO AuditLogDB.dbo.LogonEventData
+    ( 
+		LogonTime, SPID, HostName, AppName, LoginName, ClientHost
+    )
+    VALUES
+    (
+		@EventTime,	@SPID, @HostName, @AppName, @LoginName, @ClientHost
+    )
+END
+GO
+
+/*
+ Create a new query window and check the log
+*/
+SELECT * FROM AuditLogDB.dbo.LogonEventData
+ORDER BY LogonTime DESC;
+
+
+/*
+  We can reset the order of these Triggers. Because everything is run in 
+  the same transaction, more work would be needed to log attempts that
+  are successful but cross the number of connections limit.
+*/
+sp_settriggerorder @triggername = 'SuccessfulLogonAudit', @order = 'first', 
+	@stmttype = 'LOGON', @namespace = 'SERVER';
+GO
+
+sp_settriggerorder @triggername = 'LimitConnectionsForUser', @order = 'last', 
+	@stmttype = 'LOGON', @namespace = 'SERVER';
+GO
+
+
+
+
+
+
+
+
+/*
+  Cleanup
+*/
+
+DROP TRIGGER LimitConnectionsForUser ON ALL SERVER;
+DROP TRIGGER SuccessfulLogonAudit ON ALL SERVER;
+
+DROP DATABASE AuditLogDB;
+
+DROP LOGIN login_test;
\ No newline at end of file
diff --git a/Triger_Functions/Simple_Function _Samples.sql b/Triger_Functions/Simple_Function _Samples.sql
new file mode 100644
index 0000000..e81b198
--- /dev/null
+++ b/Triger_Functions/Simple_Function _Samples.sql	
@@ -0,0 +1,99 @@
+/*
+  Look at a select statement with three built-in Scalar functions
+*/
+SELECT MONTH(GETDATE()) AS [MONTH], YEAR(GETDATE()) AS [YEAR];
+GO
+
+
+/*
+  Create a very simple User-Defined, Multi-Statement Scalar Function
+*/
+CREATE OR ALTER FUNCTION dbo.SuperAdd_scaler(@a INT, @b INT)
+RETURNS INT
+WITH SCHEMABINDING
+AS
+BEGIN
+	/*
+	  Although this just happens to be one statement, I can have more than 
+	  one in a scalar function, so don't let that confuse you.
+	*/
+	RETURN @a + @b;
+END;
+GO
+
+/*
+  Do simple addition
+*/
+select dbo.SuperAdd_scaler(2,2);
+GO
+
+/*
+  Attempt to pass in bad data
+*/
+select dbo.SuperAdd_scaler('a',3);
+GO
+
+/*
+  Create a slightly more complext Multi-Statement Scalar Function that
+  returns the Fiscal Year Ending of a provided date/time.
+
+  Defaulting to June as the default Fiscal Ending Month
+*/
+CREATE OR ALTER FUNCTION dbo.FiscalYearEnding(@SaleDate DATETIME, @FiscalEndMonth INT = 6)
+RETURNS INT
+WITH SCHEMABINDING
+AS
+BEGIN
+	DECLARE @saleMonth INT = MONTH(@SaleDate);
+	DECLARE @saleYear INT = YEAR(@SaleDate);
+	DECLARE @fiscalYear INT = @saleYear;
+
+	IF(@saleMonth > @FiscalEndMonth AND @FiscalEndMonth != 1) 
+	BEGIN
+		SET @fiscalYear = @saleYear + 1;
+	END;
+
+	RETURN @fiscalYear;
+END;
+GO
+
+/*
+  Select a given date and see if we get the correct year
+*/
+
+SELECT '2019-01-01' SampleDate, dbo.FiscalYearEnding('2019-01-01',1) FiscalYear; -- 2019
+SELECT '2019-07-01' SampleDate, dbo.FiscalYearEnding('2019-07-01',6) FiscalYear; -- 2020
+SELECT '2019-07-01' SampleDate, dbo.FiscalYearEnding('2019-07-01',7) FiscalYear; -- 2019
+SELECT '2019-12-01' SampleDate, dbo.FiscalYearEnding('2019-05-01',4) FiscalYear; -- 2020
+SELECT '2019-12-01' SampleDate, dbo.FiscalYearEnding('2019-12-01',12) FiscalYear; -- 2019
+
+/*
+  Now on some real data
+*/
+SELECT TOP 100 OrderId, OrderDate, dbo.FiscalYearEnding(OrderDate, DEFAULT) as FiscalSaleYear from Sales.Orders
+ WHERE OrderDate > '2013-06-28'
+GO
+
+/*
+  As stated earlier, Scalar Functions are often used in WHERE predicates. Unfortunately
+  both of these examples are very inefficient because they prevent SARGability, which
+  we'll discuss in a bit.
+
+  These will both cause the Sales.Orders table to be scanned row-by-row to calculate the
+  year and fiscal year respectively.
+
+  Finding Orders based on YEAR 
+*/
+SELECT TOP 100 OrderId, OrderDate, dbo.FiscalYearEnding(OrderDate, DEFAULT) as FiscalSaleYear from Sales.Orders
+ WHERE YEAR(OrderDate) > 2015
+GO
+
+/*
+  Using our new FiscalYearEnding function
+*/
+SELECT TOP 100 OrderId, OrderDate, dbo.FiscalYearEnding(OrderDate, DEFAULT) as FiscalSaleYear from Sales.Orders
+ WHERE dbo.FiscalYearEnding(OrderDate,DEFAULT) > 2015
+GO
+
+
+
diff --git a/Triger_Functions/Trigger_Order.sql b/Triger_Functions/Trigger_Order.sql
new file mode 100644
index 0000000..00653e8
Binary files /dev/null and b/Triger_Functions/Trigger_Order.sql differ
diff --git a/Triger_Functions/UPDATE_AFTER.sql b/Triger_Functions/UPDATE_AFTER.sql
new file mode 100644
index 0000000..8d5ed6c
Binary files /dev/null and b/Triger_Functions/UPDATE_AFTER.sql differ
