title: How to create trigger in Visual Studio 2017 to insert log details into a table?
body: <p>I am getting error with the following code while taking the timestamp to create a log for every insertion.</p>
  
  <pre><code>CREATE TRIGGER [dbo].[log_trig]
  ON [dbo].[CUSTOMER]
  FOR INSERT
  AS
  BEGIN
      SET NoCount ON
      DECLARE @_id INT
      DECLARE @_time TIMESTAMP
      SET @_id = NEW.id
      SET @_time = now()
      insert into log values (@_id, @_time)
  END
  </code></pre>