MS SQL Server Concepts and Programming Question: Download Questions PDF
How To Create a Simple Table to Test Triggers in MS SQL Server?
Answer:
If you want to follow other tutorial examples included in this collection, you need to run this SQL script to create a simple table called ggl_users:
USE GlobalGuideLineDatabase;
GO
DROP TABLE ggl_users;
GO
CREATE TABLE ggl_users (
id INTEGER IDENTITY NOT NULL,
name VARCHAR(80) NOT NULL,
email VARCHAR(80) NULL,
password VARCHAR(32) NULL
);
INSERT INTO ggl_users (name) VALUES ('John King');
INSERT INTO ggl_users (name) VALUES ('Nancy Greenberg');
GO
ggl_users is created now with 2 records.
USE GlobalGuideLineDatabase;
GO
DROP TABLE ggl_users;
GO
CREATE TABLE ggl_users (
id INTEGER IDENTITY NOT NULL,
name VARCHAR(80) NOT NULL,
email VARCHAR(80) NULL,
password VARCHAR(32) NULL
);
INSERT INTO ggl_users (name) VALUES ('John King');
INSERT INTO ggl_users (name) VALUES ('Nancy Greenberg');
GO
ggl_users is created now with 2 records.
Download MS SQL Server Interview Questions And Answers
PDF
Previous Question | Next Question |
What Are the Basic Features of a Trigger in MS SQL Server? | How To Create a DML Trigger using CREATE TRIGGER Statements? |