我们如何在函数或存储过程中传递表名? [英] how can we pass the table name in function or store procedure?
本文介绍了我们如何在函数或存储过程中传递表名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果是,那么如何?
因为我创建的参数名称函数应该是表名。
if yes then how?
because i am create a function with parameter name should be table name.
推荐答案
你可以通过表名作为字符串。
You can pass the table name as a string.
正如Abhinav S所说,您可以将表名作为字符串传递。
As Abhinav S said you can pass the table name as a string.
EXECUTE mySP 'mytable'
CREATE PROCEDURE mySP (@mtab VARCHAR(100)) AS...
在SP中使用它是另一个问题。
Using it in the SP is another problem.
这篇关于我们如何在函数或存储过程中传递表名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文