我可以在脚本或存储过程中创建一次性使用函数吗? [英] Can I create a One-Time-Use Function in a Script or Stored Procedure?
本文介绍了我可以在脚本或存储过程中创建一次性使用函数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 SQL Server 2005 中,是否有在 SQL 脚本或存储过程中声明的一次性使用或本地函数的概念?我想抽象出我正在编写的脚本中的一些复杂性,但这需要能够声明一个函数.
In SQL Server 2005, is there a concept of a one-time-use, or local function declared inside of a SQL script or Stored Procedure? I'd like to abstract away some complexity in a script I'm writing, but it would require being able to declare a function.
只是好奇.
推荐答案
您可以在脚本开头附近调用 CREATE Function
,在脚本末尾附近调用 DROP Function
.
You can call CREATE Function
near the beginning of your script and DROP Function
near the end.
这篇关于我可以在脚本或存储过程中创建一次性使用函数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文