如何在SQL Server中将长存储过程写为子存储过程 [英] how to write long stored procedure as sub stored procedures in sql server

查看:106
本文介绍了如何在SQL Server中将长存储过程写为子存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的存储过程很长.

它具有64个条件.

Iam根据64个条件检索数据.

是否可以在一个存储过程中写入64个条件?
或有其他任何方法吗?

例如:-

我有6个参数.这些是

位置,日期,Jobindustry,Jobterm,Minsal,maxsal

Iam根据我的条件检索数据,例如所有参数均为null或选择任意一个或选择任意两个或选择任意三个或任意四个或任意五个或全部选择.




我如何将其写为子存储过程????

Hi
My stored procedure is very long.

It has 64 conditions.

Iam retrieving the data based on 64 conditions.

Is it possible to write 64 conditions in one stored procedure????

or any other method is there??

For Example:-

I have 6 parameters.Those are

Location,Date,Jobindustry,Jobterm,Minsal,maxsal

Iam retrieving the data based on my conditions like all parameters are null or any one is select or any two are select or any three or any four or any five or all select.




how can i write that as sub storedprocedures?????

推荐答案

您可以使用exec调用存储过程,
因此,请尝试吐出它,并相应地传递所需的参数,然后调用它们.
You can use exec to call a stored procedure,
So try to spit it, and pass the required parameter accordingly and call them.


这篇关于如何在SQL Server中将长存储过程写为子存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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