簡體   English   中英

多租戶應用程序的數據庫配置

[英]Database provisioning of a multi tenant application

我正在開發一個多租戶應用程序,該程序將自動執行配置過程。

設置過程將創建一個具有表,過程,函數的新SQL Server數據庫,並將默認數據插入數據庫。

我的問題是執行此過程的最佳方法是什么?

我的感覺是:

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.

在嘗試從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'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM