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. Centralised Stored Proc.

Centralised Stored Proc.

Scheduled Pinned Locked Moved Database
databasequestionsysadmin
5 Posts 4 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.
  • R Offline
    R Offline
    RChin
    wrote on last edited by
    #1

    Quick Question: I have a number of SQL/MSDE databases on the local company server. Each database uses identical stored procedures for quick updates to their record items.

    Can I use just one copy of the stored procedure for use by all the databases, instead of duplicate in each one? If yes, does this have to go in the master database. How would you distinguish the active database (perhaps using Using dbo.???)?


    I Dream of Absolute Zero

    C H 2 Replies Last reply
    0
    • R RChin

      Quick Question: I have a number of SQL/MSDE databases on the local company server. Each database uses identical stored procedures for quick updates to their record items.

      Can I use just one copy of the stored procedure for use by all the databases, instead of duplicate in each one? If yes, does this have to go in the master database. How would you distinguish the active database (perhaps using Using dbo.???)?


      I Dream of Absolute Zero

      C Offline
      C Offline
      Carlos Antollini
      wrote on last edited by
      #2

      You must to inform the database by parameter.... I worked in a proyect where each database had the data of an specific mounth and Year. To solve that we had a central DB with the stored procedures and a set of parameters, for example, the name of the last DB, and the name of the previous DBs, etc.... Regards.... Carlos Antollini Do you know piFive[^] ?

      1 Reply Last reply
      0
      • R RChin

        Quick Question: I have a number of SQL/MSDE databases on the local company server. Each database uses identical stored procedures for quick updates to their record items.

        Can I use just one copy of the stored procedure for use by all the databases, instead of duplicate in each one? If yes, does this have to go in the master database. How would you distinguish the active database (perhaps using Using dbo.???)?


        I Dream of Absolute Zero

        H Offline
        H Offline
        Hesham Amin
        wrote on last edited by
        #3

        try adding the new stored procedures to the model database all new databases are a copy of the model database so they will contain the stored procedures you created.

        C 1 Reply Last reply
        0
        • H Hesham Amin

          try adding the new stored procedures to the model database all new databases are a copy of the model database so they will contain the stored procedures you created.

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

          True, but if one of the stored procedures needs to be updated, it will then have to be applied to all databases.


          "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

          R 1 Reply Last reply
          0
          • C Colin Angus Mackay

            True, but if one of the stored procedures needs to be updated, it will then have to be applied to all databases.


            "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!

            R Offline
            R Offline
            RChin
            wrote on last edited by
            #5

            Colin Angus Mackay wrote: but if one of the stored procedures needs to be updated, it will then have to be applied to all databases Exactly. What I was after is a central location where all the databases could access these SPs. Changes to the SP would then immediately be reflected to all the databases. I have searched, but to no avail. I can only assume that this is not [easily] possible.


            I Dream of Absolute Zero

            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