|
-
May 11th, 2005, 04:30 AM
#1
Thread Starter
Hyperactive Member
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..
-
May 11th, 2005, 05:06 AM
#2
Frenzied Member
Re: stored procedure
 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..
-
May 12th, 2005, 03:08 AM
#3
Re: stored procedure
 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.....
-
May 12th, 2005, 04:41 AM
#4
Thread Starter
Hyperactive Member
Re: stored procedure
 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??)
-
May 12th, 2005, 05:03 AM
#5
Re: stored procedure
This might give you a better answer.....
-
May 12th, 2005, 05:23 AM
#6
Thread Starter
Hyperactive Member
Re: stored procedure
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|