在vb.net应用程序中SQL Stored Proc的最佳实践是什么? [英] What is the best practice SQL Stored Proc in vb.net application

查看:75
本文介绍了在vb.net应用程序中SQL Stored Proc的最佳实践是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想知道我目前在我的应用程序中有一个使用大约5个存储过程的进程,它们可以合并到一个存储过程中,因为它们不使用任何参数并且它们用于在读取一些文本文件后更新我的数据库中的某些表。



我想知道更好的做法是继续打开数据库连接运行一个proc然后关闭与db的连接并再次打开连接并运行第二个proc并关闭db con等,或者将5procs组合成单个proc并运行单个proc更好吗?

Hi
I would like to know i currently have a process in my application that uses about 5 stored procs which could be combined into a single stored proc as they dont use any parameters and they are used to update certain tables in my database after reading some text files.

I would like to know is it better practice to keep opening the db connection run the one proc and then close the connection to the db and open the conection again and run the second proc and close db con etc or would it be better to combine the 5procs into a single proc and run the single proc?

推荐答案

您好isi19,



在第6次Proc中执行5次proc时,请确保在Sql Transaction中执行它们。
Hi isi19,

While executing 5 procs in 6th Proc make sure you exectute them in Sql Transaction.


这篇关于在vb.net应用程序中SQL Stored Proc的最佳实践是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆