SQL Server Performance
  1. i want to use trigger in my application for insert and delete record from one method i call trigger how this is possible
  2. hi how can i use trigger in c# i want to insert and delete record in different table by triiger
  3. FrankKalis Moderator

    Welcome to the forum!
    First of all you cannot call a trigger directly from C# (or even T-SQL, for that matter). A trigger is fired when a certain event is raised, such as an INSERT. A very basic skeleton for an INSERT trigger probably would look like this:
    CREATE TRIGGER dbo.SomeFancyTrigger ON dbo.SomeFancyTable
    AFTER INSERT, UPDATE
    AS
    INSERT INTO dbo.SomeFancyOtherTable
    (...)
    SELECT
    ...
    FROM
    INSERTED;
    GO
    You can find more on triggers here: CREATE TRIGGER
  4. satya Moderator

Share This Page