Add user with DDL Trigger
DDL trigger will add a user to a newly created database and assign db_owner role. It can be modified for what role is required.
2015-03-12 (first published: 2013-08-22)
1,615 reads
DDL trigger will add a user to a newly created database and assign db_owner role. It can be modified for what role is required.
2015-03-12 (first published: 2013-08-22)
1,615 reads
A previous tip, SQL Server DDL Triggers to Track All Database Changes, generated a lot of discussion involving ways to make the provided DDL trigger more useful. Check out this tip to expand your knowledge on DDL Triggers.
2013-06-10
2,988 reads
In this tip Aaron Bertrand describes some of the ways in which you can extend the DDL trigger functionality.
2013-05-30
4,116 reads
2012-01-18
2,258 reads
Using a DDL trigger, two schemas and a stored procedure recycle bin functionality can be create in SQL Server.
2009-05-20
13,701 reads
How to use DDL triggers and Query the Data with minimum performance impact.
2008-10-02
1,818 reads
2012-07-17 (first published: 2007-11-21)
2,251 reads
By Steve Jones
This value is something that I still hear today: our best work is done...
By gbargsley
Have you ever received the dreaded error from SQL Server that the TempDB log...
By Chris Yates
Artificial intelligence is no longer a distant concept. It is here, embedded in the...
Comments posted to this topic are about the item Planning for tomorrow, today -...
We have a BI-application that connects to input tables on a SQL Server 2022...
At work we've been getting better at writing what's known as GitHub Actions (workflows,...
I try to run this code on SQL Server 2022. All the objects exist in the database.
CREATE OR ALTER VIEW OrderShipping AS SELECT cl.CityNameID, cl.CityName, o.OrderID, o.Customer, o.OrderDate, o.CustomerID, o.cityId FROM dbo.CityList AS cl INNER JOIN dbo.[Order] AS o ON o.cityId = cl.CityNameID GO CREATE OR ALTER FUNCTION GetShipCityForOrder ( @OrderID INT ) RETURNS VARCHAR(50) WITH SCHEMABINDING AS BEGIN DECLARE @city VARCHAR(50); SELECT @city = os.CityName FROM dbo.OrderShipping AS os WHERE os.OrderID = @OrderID; RETURN @city; END; goWhat is the result? See possible answers