在MSSql Server中以编程方式创建存储过程 [英] Creating Stored Procedure programmatically in MSSql Server

查看:82
本文介绍了在MSSql Server中以编程方式创建存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请有人帮忙解决如何在MSSql Server中以编程方式创建存储过程

Please somebody help out on how to create Stored Procedure programmatically in MSSql Server

推荐答案

如果您实际上提到了要使用的语言,那可能会很好进入.我几乎没有注意到C#标签.

执行一个SqlCommand(使用ExecuteNonQuery),其CommandText包含整个Create Procedure TSQL命令的全部内容:

It might have been nice if you actually mentioned what language you wanted to do this in. I almost did not notice the C# tag.

Execute an SqlCommand (use ExecuteNonQuery) whose CommandText contains the entirety of the Create Procedure TSQL command:

Create Procedure MyProc 
@myfirstParam int = 0,
...
@mylastparam nvarchar(255) = null
As
Begin
....
End


这篇关于在MSSql Server中以编程方式创建存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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