我有一个简单的存储过程,如下所示
Create PROCEDURE [dbo].[insertMessage] --@msgTypeName NVARCHAR(50), --@msgTypeDescription NVARCHAR AS BEGIN SET NOCOUNT ON; -- Insert statements for procedure here INSERT INTO [dbo].[tblMessageLookup] (strMessageType, strMessageDescription,DateCreated,DateModified) VALUES ('TrainList', 'TrainList',GETDATE(),GETDATE()); INSERT INTO [dbo].[tblMessageLookup] (strMessageType, strMessageDescription,DateCreated,DateModified) VALUES ('Schedule', 'Schedule',GETDATE(),GETDATE()); INSERT INTO [dbo].[tblMessageLookup] (strMessageType, strMessageDescription,DateCreated,DateModified) VALUES ('Stockpile', 'Stockpile',GETDATE(),GETDATE()); INSERT INTO [dbo].[tblMessageLookup] (strMessageType, strMessageDescription,DateCreated,DateModified) VALUES ('Forecast', 'Forecast',GETDATE(),GETDATE()); END
如果我执行存储过程,它将在我的表中创建三行,但我正在尝试自动执行此过程.所以我想为此创建一个Windows安装程序,因为项目的其余部分(Windows应用程序)有一个Windows安装程序来安装项目.
有没有什么办法可以为存储过程创建安装程序或将其添加到现有的Windows安装程序?
MSDN上有一篇文章介绍了如何在安装项目中使用自定义操作,以便在安装过程中创建数据库.Walkthrough: Using a Custom Action to Create a Database During Installation
您可以使用自己的代码更改用于创建数据库的SQL – 创建过程,执行它或两者(从您的问题中不清楚您想要做什么).
查看更多关于c# – 如何将存储过程添加到Windows Installer中的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did69383