Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to write triggers in stored procedure

How to write triggers in stored procedure

Scheduled Pinned Locked Moved Database
databasetutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sophia Rekhi
    wrote on last edited by
    #1

    Hi all, i want to know that "how to write triggers in stored procedures" is it possible? and can we write cursors in stored procedures? if yes then pls send me solution. Thanks

    V C 2 Replies Last reply
    0
    • S Sophia Rekhi

      Hi all, i want to know that "how to write triggers in stored procedures" is it possible? and can we write cursors in stored procedures? if yes then pls send me solution. Thanks

      V Offline
      V Offline
      vimal_yet
      wrote on last edited by
      #2

      declare cursor for open cursor_name while @@fetch_status=0 begin fetch next from cursor_name into variable_name1,var2......varn end If U Get Errors U Will Learn If U Don't Get Errors U Have Learnt

      1 Reply Last reply
      0
      • S Sophia Rekhi

        Hi all, i want to know that "how to write triggers in stored procedures" is it possible? and can we write cursors in stored procedures? if yes then pls send me solution. Thanks

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        Sophia Rekhi wrote:

        i want to know that "how to write triggers in stored procedures" is it possible?

        A trigger is a stored procedure of sorts that is run automatically on an event, such as data being inserted into a table. I don't understand the benefit of writing one in a stored procedure? I also doubt if it is possible. You could write some dynamic SQL and execute that in order to create a trigger from within a stored procedure, but wouldn't it be better just to write the trigger and be done with it?


        Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups