Avatar of Favorable
FavorableFlag for United States of America

asked on 

SQL Server Create Triggers

Please somebody help me with the following:

I need a insert / update Trigger for table[ActionType] column name is [actiontimestamp].

Trigger will insert the current timestamp into the column.  Only on Insert and update.



Here is my table and the columns just incase:
CREATE TABLE [dbo].[ActionType](
                [id] [int] IDENTITY(1,1) NOT NULL,
                [long_type] [varchar](30) NULL,
                [dc_id] [varchar](5) NULL,
                [Backups] [varchar](max) NULL,
                [dateofincidence] [datetime] NOT NULL,
                [actiontimestamp] [timestamp] NULL
) ON [PRIMARY]

Microsoft SQL Server 2008SQL

Avatar of undefined
Last Comment
Favorable
ASKER CERTIFIED SOLUTION
Avatar of Lowfatspread
Lowfatspread
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of bee4jay
bee4jay

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of nishant joshi
nishant joshi
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
but creating triggers decreases the sql server performance.
Avatar of Favorable
Favorable
Flag of United States of America image

ASKER

Thanks to everyone
SQL
SQL

SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.

61K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo