开发者

Is it possible to save and reuse a set of Parameters as a code block in SQL Server Express 2005?

开发者 https://www.devze.com 2022-12-17 16:15 出处:网络
I have several stored procedures that all use the same set of parameters.Is there a way to define and save the parameter list as a reusable block of code?Something like this:

I have several stored procedures that all use the same set of parameters. Is there a way to define and save the parameter list as a reusable block of code? Something like this:

CREATE PROCEDURE test
    Using StoredParameterList 
AS
BEGIN
    SQL Statement
END

Is this possible? It would make code maintena开发者_运维技巧nce easier if a parameter needed to be changed.


Well, sort of. I've never used them, but Sql Server supports something called User Defined Types. I suspect you can create a user-defined type that represents your parameter list and then just have one parameter on each procedure with UDT.

0

精彩评论

暂无评论...
验证码 换一张
取 消