我正在开发一个多租户应用程序,其中的配置过程将自动进行。
资源调配过程将创建一个包含表、过程、函数的新SQL Server数据库,并将默认数据插入到数据库中。
我的问题是,完成这一过程的最佳方法是什么?
发布于 2012-08-14 17:49:06
在尝试从C#执行数据库脚本之后,我决定使用下面的脚本以编程方式恢复数据库。
RESTORE FILELISTONLY
FROM DISK = 'C:\BaackUpFile.bak'
RESTORE DATABASE DbName
FROM DISK = 'C:\BaackUpFile.bak'
WITH MOVE 'YourMDFLogicalName' TO 'C:\DataYourMDFFile.mdf',
MOVE 'YourLDFLogicalName' TO 'C:\DataYourLDFFile.ldf'发布于 2012-08-09 15:23:30
我的感觉是:
1.Create multiple sets of SQL scripts like DBScripts,TableScripts,ProcScripts ect.
2.In DBScripts,just add create database code and here you can hardcode the db name also.
3.And whenver there are any changes in these scripts you can edit and release the new build for the client.
4.Client just has to click some button on front end to create DB,Tables,Sprocs etc.https://stackoverflow.com/questions/11878353
复制相似问题