CREATE TRIGGER safety
ON DATABASE
FOR DROP_TABLE, ALTER_TABLE
AS
PRINT 'You must disable Trigger safety before dropping or altering tables.';
ROLLBACK;
CREATE TRIGGER safety
ON DATABASE
FOR DROP_TABLE, ALTER_TABLE
AS
PRINT 'You must disable Trigger safety before dropping or altering tables.';
ROLLBACK;
CREATE TRIGGER prevent_create_table
ON DATABASE
FOR CREATE_TABLE
AS
PRINT 'Table creation is not allowed.';
ROLLBACK;
CREATE TABLE TestTable (ID INT);
CREATE TRIGGER log_ddl_changes
ON DATABASE
FOR CREATE_TABLE, DROP_TABLE, ALTER_TABLE
AS
DECLARE @event xml;
SET @event = EVENTDATA();
INSERT INTO DDLLog (PostTime, Event) VALUES (GETDATE(), @event.value('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]', 'nvarchar(max)'));
CREATE TRIGGER prevent_alter_table
ON DATABASE
FOR ALTER_TABLE
AS
IF ORIGINAL_LOGIN() != 'admin'
BEGIN
PRINT 'Only the admin can alter tables.';
ROLLBACK;
END
Back-end App Developer
Front-end Web Developer
Full Stack Developer (Java)
Full Stack Developer (.Net)
Full Stack Developer (MEAN)
Full Stack Developer (MERN)
DevOps Engineer
Database Engineer (AzureSQL)
Database Engineer (Oracle)
Database Engineer (General)
Solution Architect (.NET)
Solution Architect (Java)
Solution Architect (Ruby)
Solution Architect (Python)
AI Engineer (Python)
Sr. AI Engineer (Python)
AI Strategist (Python)
Business Intelligence Engineer
Systems Analyst
Mainframe Developer (COBOL)
Mainframe Developer (General)