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. SQL DATABASE

SQL DATABASE

Scheduled Pinned Locked Moved Database
databasedebugginghelptutorialquestion
11 Posts 5 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.
  • I Offline
    I Offline
    It_tech
    wrote on last edited by
    #1

    Hi all, Could You please let me know how to trace a Stored Procedure modifications history within a certain period of time? Including the conetnet of a Stored Procedures at a particular period of time. Many thanks for your help.

    D L 2 Replies Last reply
    0
    • I It_tech

      Hi all, Could You please let me know how to trace a Stored Procedure modifications history within a certain period of time? Including the conetnet of a Stored Procedures at a particular period of time. Many thanks for your help.

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Source control software? If you are using TFS then that provides source control as well.

      I S 2 Replies Last reply
      0
      • D dan sh

        Source control software? If you are using TFS then that provides source control as well.

        I Offline
        I Offline
        It_tech
        wrote on last edited by
        #3

        Thanks very much for your response.Its much appreciated.I didnt have TFS ,I am just running Sql 2008 and wated to know the content of a particular Stored procedure at one time back before modification. Please advice.

        D 1 Reply Last reply
        0
        • I It_tech

          Hi all, Could You please let me know how to trace a Stored Procedure modifications history within a certain period of time? Including the conetnet of a Stored Procedures at a particular period of time. Many thanks for your help.

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

          As d@nish said, you'd best keep a copy of your procedures in a safe location. The database itself doesn't version the procedures, there's no change-history by default. Try restoring a database-backup that contains the correct version of the sp's. --edit; (to prevent this)

          • Script your entire database, in the version that you're releasing to the customer(s).
          • Archive them somewhere safe (SourceSafe - don't forget to label it, or even burned and nicely indexed on CD)
          • Include all unit-tests for your procdures!
          • Consider whether the sprocs have any dependencies themselves, like functions, views or other procedures.
          • A scripter[^] might come in handy.

          I are Troll :suss:

          modified on Thursday, August 26, 2010 6:22 PM

          P 1 Reply Last reply
          0
          • I It_tech

            Thanks very much for your response.Its much appreciated.I didnt have TFS ,I am just running Sql 2008 and wated to know the content of a particular Stored procedure at one time back before modification. Please advice.

            D Offline
            D Offline
            dan sh
            wrote on last edited by
            #5

            Have a database project in your code which will have all the scripts logically placed in separate folders. Database will not do this for you. Either usea source control software or take regular backups. Former, IMHO, is simpler and suitable for your requirement. If you don't have a DB backup, you cannot revert back unless you manually edit things.

            1 Reply Last reply
            0
            • L Lost User

              As d@nish said, you'd best keep a copy of your procedures in a safe location. The database itself doesn't version the procedures, there's no change-history by default. Try restoring a database-backup that contains the correct version of the sp's. --edit; (to prevent this)

              • Script your entire database, in the version that you're releasing to the customer(s).
              • Archive them somewhere safe (SourceSafe - don't forget to label it, or even burned and nicely indexed on CD)
              • Include all unit-tests for your procdures!
              • Consider whether the sprocs have any dependencies themselves, like functions, views or other procedures.
              • A scripter[^] might come in handy.

              I are Troll :suss:

              modified on Thursday, August 26, 2010 6:22 PM

              P Online
              P Online
              PIEBALDconsult
              wrote on last edited by
              #6

              Eddy Vluggen wrote:

              The database itself doesn't version the procedures,

              Another argument against using stored procedures.

              S 1 Reply Last reply
              0
              • P PIEBALDconsult

                Eddy Vluggen wrote:

                The database itself doesn't version the procedures,

                Another argument against using stored procedures.

                S Offline
                S Offline
                SilimSayo
                wrote on last edited by
                #7

                The database does not version any objects [Tables, Views, Triggers, Functions and Stored Procedures]; so using your argument, should we avoid databases altogether?

                L P 2 Replies Last reply
                0
                • S SilimSayo

                  The database does not version any objects [Tables, Views, Triggers, Functions and Stored Procedures]; so using your argument, should we avoid databases altogether?

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

                  SilimSayo wrote:

                  PIEBALDConsult wrote:

                  Another argument against using stored procedures.

                  The database does not version any objects [Tables, Views, Triggers, Functions and Stored Procedures]; so using your argument, should we avoid databases altogether?

                  It's not the non-versioning that's bad, it's sproc's. PI isn't saying that the database should do versioning, he just found an argument against sprocs. Like the argument or not, inline Sql usually gets backed up with the source. Yes, some people will prefer sprocs. I prefer whatever my client pays me to, as it's kinda easy to switch between the two. Yes, we can start a religious argument on the topic, but that shouldn't be part of the answer. How 'bout the lounge?

                  I are Troll :suss:

                  1 Reply Last reply
                  0
                  • S SilimSayo

                    The database does not version any objects [Tables, Views, Triggers, Functions and Stored Procedures]; so using your argument, should we avoid databases altogether?

                    P Online
                    P Online
                    PIEBALDconsult
                    wrote on last edited by
                    #9

                    A database is for data; not code. Use a code base for code.

                    S 1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      A database is for data; not code. Use a code base for code.

                      S Offline
                      S Offline
                      SilimSayo
                      wrote on last edited by
                      #10

                      Indeed... So all those big database vendors must have been damn to include programming(coding) capabilities.

                      1 Reply Last reply
                      0
                      • D dan sh

                        Source control software? If you are using TFS then that provides source control as well.

                        S Offline
                        S Offline
                        SilimSayo
                        wrote on last edited by
                        #11

                        We use code version tool. We also include the version number as comments in stored procedures and functions. Out versioning tool automatically applies the versioning comments.

                        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