Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Unanswered: convert trigger to sp

    hi folks,
    can uexplain how come it is possible to convert trigger to stored procdure
    .pls explain with an example

  2. #2
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    Here's an example of a simple INSERT proc.

    Code:
    CREATE PROC dbo.prc_tblInsert
    (@x INT, @y INT, @z INT)
    AS
    BEGIN;
    
    	SET NOCOUNT ON;
    	
    	INSERT INTO dbo.tbl (x, y, z)
    	VALUES (@x, @y, @z);
    
    	RETURN;
    
    END;

  3. #3
    Join Date
    Apr 2009
    Posts
    2
    thanks for ur reply.
    i need an example for comparsion between triggers and stored procedure.Not for sp alone.

  4. #4
    Join Date
    Dec 2007
    Location
    London, UK
    Posts
    741
    A trigger IS a stored procedure, ie. a "triggered" stored procedure. If you explain what you want the procedure to do then someone may be able to help you write it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •