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. Need Help in SQL Server "Stored Procedure"

Need Help in SQL Server "Stored Procedure"

Scheduled Pinned Locked Moved Database
databasehelptutorialquestionsql-server
4 Posts 3 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.
  • D Offline
    D Offline
    dr_iton
    wrote on last edited by
    #1

    I know how to make a Stored Procedure that its data affect in one TABLE. The problem is that I'm making a three tier project, and I'm inserting, Updating Reading and Deleting data to tables using Stored Procedure. My question is, how to make a tored procedure that its data are affecting two tables? For example. TABLE1 has coulmns Name and Age, and TABLE2 has columns Year and Time. How to programm one procedure using parameters of two tables. P.S. Is it possible to create a procedure that its data can be stored in two tables? Thank you in advance for your time.

    C 1 Reply Last reply
    0
    • D dr_iton

      I know how to make a Stored Procedure that its data affect in one TABLE. The problem is that I'm making a three tier project, and I'm inserting, Updating Reading and Deleting data to tables using Stored Procedure. My question is, how to make a tored procedure that its data are affecting two tables? For example. TABLE1 has coulmns Name and Age, and TABLE2 has columns Year and Time. How to programm one procedure using parameters of two tables. P.S. Is it possible to create a procedure that its data can be stored in two tables? Thank you in advance for your time.

      C Offline
      C Offline
      Corporal Agarn
      wrote on last edited by
      #2

      Have no idea what database program you are using so I will speak about MS SQL Server. A stored procedure may touch many tables. One set of data may be put into many tables. If Table1 and Table2 do not have a shared column (PersonID for example) it becomes very hard to join the two.

      D 1 Reply Last reply
      0
      • C Corporal Agarn

        Have no idea what database program you are using so I will speak about MS SQL Server. A stored procedure may touch many tables. One set of data may be put into many tables. If Table1 and Table2 do not have a shared column (PersonID for example) it becomes very hard to join the two.

        D Offline
        D Offline
        dr_iton
        wrote on last edited by
        #3

        I solved the problem. Thank you a lot. I used the nested BEGIN and END between two tables. Cheers.

        G 1 Reply Last reply
        0
        • D dr_iton

          I solved the problem. Thank you a lot. I used the nested BEGIN and END between two tables. Cheers.

          G Offline
          G Offline
          gvprabu
          wrote on last edited by
          #4

          What nested BEGIN and END..? used in your Stored Procedure.

          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