Results 1 to 11 of 11

Thread: stored procedure

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    stored procedure

    Im not sure if this the correct forum but anyway...

    i'm am rewriting some update code which is used to update several tables in my sql server 2000 database, and am considering using stored procedure as I have read they help to improve performance (and I might require introduce some more security which can be done using stored procedure...)

    I am very new to programming…..

    1)when writing the sp can I write 1 stored procedure to update all tables, or is that not possible since some parameters have differernt names in the different tables??? And should all tables be updated using stored procedure..

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: stored procedure

    Quote Originally Posted by pame1la
    Im not sure if this the correct forum but anyway...

    i'm am rewriting some update code which is used to update several tables in my sql server 2000 database, and am considering using stored procedure as I have read they help to improve performance (and I might require introduce some more security which can be done using stored procedure...)

    I am very new to programming…..

    1)when writing the sp can I write 1 stored procedure to update all tables, or is that not possible since some parameters have differernt names in the different tables??? And should all tables be updated using stored procedure..
    Well... Always using Stored Procedure to perform database operations, is not a rule of thumb....

    Stored Procedures are better in performance because the code within them is already compiled and so the time of Database Engine for compiling the query again and again is saved...

    and obviously you shouldn't use one stored procedure to update all the tables... this is against the structured approach..

    Use Stored Procedure when there is a query or set of database commands which are frequently being called by front-end...

    About me... i don't use Stored Procedure to insert data into tables..one of the normal case when i use them is when i need to validate some user input against the values in one or more tables in the database..

  3. #3
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: stored procedure

    Quote Originally Posted by moinkhan
    About me... i don't use Stored Procedure to insert data into tables..
    Could you share why, is it a personal decision? Or have you encountered some problems when using stored procedures to insert data? This is really intriguing because I have always thought that using Stored Procedures for your data manipulation is the best way to go.....
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Re: stored procedure

    Quote Originally Posted by dee-u
    Could you share why, is it a personal decision? Or have you encountered some problems when using stored procedures to insert data? This is really intriguing because I have always thought that using Stored Procedures for your data manipulation is the best way to go.....

    So would you advise using a stored proc when updating any table (even when updated few columns??)

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: stored procedure

    This might give you a better answer.....
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Re: stored procedure

    Quote Originally Posted by dee-u
    This might give you a better answer.....
    Thanks, that document was well useful! I think i will be changing the whole update stage and create stored proc 4 each table needed to b updated

    Thanks 4 ur help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width