borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (can not use like in sql???)Next Topic (Regarding FlexGrid) New Topic New Poll Post Reply
AndreaVB Forum : Database : store procedure and VB? Solved Topic
Poster Message
luckyboy
Level: VB Lord

Registered: 05-05-2005
Posts: 161

icon store procedure and VB?

hi all. i wonder what is better between used store procedure for update and use normal where update. my friend told me that if we use update sql state in vb, it is slower than store procedure.

'vb update
for example: con.execute "update tblstudent set score=100 where studentid=1"

'and procedure update
'con.execute "st_student....."

____________________________
Please help out.

11-05-2006 at 08:20 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: store procedure and VB?

Hi,
Your friend is quite correct.  In simple terms, any SQL statement needs to be checked by the database engine (SQL-Server / MySQL) before being executed, but if the procedure has been stored then that means that it has already been checked and optimized for execution - which means that one step of the process does not need to take place so it all happens more quickly!


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

11-05-2006 at 08:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
parosky
Level: Trainee

Registered: 31-05-2006
Posts: 2
icon Re: store procedure and VB?

Your friend is truly right. But I will advise you leave the use of stored procedures for those query you will have to execute several times. This is because stored procedures are slower at their first execution because they are being compiled before execution. Subsequent executions will then be faster because compilation will no longer be done, just straight execution.

31-05-2006 at 03:20 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : store procedure and VB? Solved Topic
Previous Topic (can not use like in sql???)Next Topic (Regarding FlexGrid) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder