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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL SERVER TRIGGERS

SQL SERVER TRIGGERS

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelpquestion
14 Posts 7 Posters 1 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 sris 426

    Hi all, I need to insert a record in to a table automatically on every day at 12 PM.How can I achive this.Will trigger help me in this regard.If not how can I achive this.Please help me.(I want to perform this action in backend only) Thanks in advance, Srinivas Mateti

    I Offline
    I Offline
    i i i
    wrote on last edited by
    #2

    You can create a Job , which db are you using ???

    Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it

    S 1 Reply Last reply
    0
    • S sris 426

      Hi all, I need to insert a record in to a table automatically on every day at 12 PM.How can I achive this.Will trigger help me in this regard.If not how can I achive this.Please help me.(I want to perform this action in backend only) Thanks in advance, Srinivas Mateti

      B Offline
      B Offline
      Blikkies
      wrote on last edited by
      #3

      Triggers execute in response to certain events when INSERT, UPDATE or DELETE

      S 1 Reply Last reply
      0
      • I i i i

        You can create a Job , which db are you using ???

        Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it

        S Offline
        S Offline
        sris 426
        wrote on last edited by
        #4

        I will be using both MSSQL and MySQL data bases. Thanks, Srinivas Mateti

        M 1 Reply Last reply
        0
        • B Blikkies

          Triggers execute in response to certain events when INSERT, UPDATE or DELETE

          S Offline
          S Offline
          sris 426
          wrote on last edited by
          #5

          So in this case I cant use triggers..right?

          B 1 Reply Last reply
          0
          • S sris 426

            Hi all, I need to insert a record in to a table automatically on every day at 12 PM.How can I achive this.Will trigger help me in this regard.If not how can I achive this.Please help me.(I want to perform this action in backend only) Thanks in advance, Srinivas Mateti

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #6

            u hv to write a windows service for this.where u can set the exact time.

            Thanks and Regards Sujit Kr. Mandal

            I 1 Reply Last reply
            0
            • S sris 426

              I will be using both MSSQL and MySQL data bases. Thanks, Srinivas Mateti

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #7

              MSSQL you can create a stored procedure to do the insert and then schedule a job to execute the procedure when required. MySQL - I don't know. As suggested you could use a windows service to do both inserts.

              S D 2 Replies Last reply
              0
              • L Lost User

                u hv to write a windows service for this.where u can set the exact time.

                Thanks and Regards Sujit Kr. Mandal

                I Offline
                I Offline
                i i i
                wrote on last edited by
                #8

                no need to invent the wheel again Sql server job will do the job

                Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it

                1 Reply Last reply
                0
                • M Mycroft Holmes

                  MSSQL you can create a stored procedure to do the insert and then schedule a job to execute the procedure when required. MySQL - I don't know. As suggested you could use a windows service to do both inserts.

                  S Offline
                  S Offline
                  sris 426
                  wrote on last edited by
                  #9

                  Thanks for the reply.Here the constraint is I cannot use Windowse services.So, I will schedule a job whichi will fire on each day at specific time.In this job i will call the SP which will insert or update the desired record.I hore in MYSQL ALSO it will works.Right.... Thanks, Srinivas Mateti

                  M 1 Reply Last reply
                  0
                  • S sris 426

                    Thanks for the reply.Here the constraint is I cannot use Windowse services.So, I will schedule a job whichi will fire on each day at specific time.In this job i will call the SP which will insert or update the desired record.I hore in MYSQL ALSO it will works.Right.... Thanks, Srinivas Mateti

                    M Offline
                    M Offline
                    Mycroft Holmes
                    wrote on last edited by
                    #10

                    If MySQL does not support jobs then you may be able to trick SQL Server into doing the job on MySQL as a remote server or a linked server, nasty but it may be possible.

                    S 1 Reply Last reply
                    0
                    • M Mycroft Holmes

                      If MySQL does not support jobs then you may be able to trick SQL Server into doing the job on MySQL as a remote server or a linked server, nasty but it may be possible.

                      S Offline
                      S Offline
                      sris 426
                      wrote on last edited by
                      #11

                      Oho..This will create more problem for me.I cannot use SQLSERVER to trigger MYSQL.I canot use windowse services.But I need the auto insert action...Is there any other option in MySQl which is similar to MSSQL jobs feature.Please guide me. Thanks in advance, Srinivas Mateti

                      1 Reply Last reply
                      0
                      • M Mycroft Holmes

                        MSSQL you can create a stored procedure to do the insert and then schedule a job to execute the procedure when required. MySQL - I don't know. As suggested you could use a windows service to do both inserts.

                        D Offline
                        D Offline
                        David Skelly
                        wrote on last edited by
                        #12

                        MySQL has an event scheduler which can be used to fire off tasks at specified times or intervals.

                        1 Reply Last reply
                        0
                        • S sris 426

                          So in this case I cant use triggers..right?

                          B Offline
                          B Offline
                          Blikkies
                          wrote on last edited by
                          #13

                          Correct

                          1 Reply Last reply
                          0
                          • S sris 426

                            Hi all, I need to insert a record in to a table automatically on every day at 12 PM.How can I achive this.Will trigger help me in this regard.If not how can I achive this.Please help me.(I want to perform this action in backend only) Thanks in advance, Srinivas Mateti

                            M Offline
                            M Offline
                            Md Marufuzzaman
                            wrote on last edited by
                            #14

                            I think you can create a stored procedure for the insertion and call it from a SQL job that's it;

                            I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.


                            Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. Thanks Md. Marufuzzaman

                            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