共用方式為


DbProviderServices.CreateDatabaseScript(String, StoreItemCollection) 方法

定義

產生用於建立結構描述物件 (資料表、主索引鍵、外部索引鍵) 的資料定義語言 (DDL) 指令碼,這個指令碼所建立的結構描述物件會以 StoreItemCollection 參數內容為根據,並以對應至提供者資訊清單語彙基元的資料庫版本為目標。

public string CreateDatabaseScript(string providerManifestToken, System.Data.Entity.Core.Metadata.Edm.StoreItemCollection storeItemCollection);
member this.CreateDatabaseScript : string * System.Data.Entity.Core.Metadata.Edm.StoreItemCollection -> string

參數

providerManifestToken
String

提供者資訊清單語彙基元,可識別目標版本。

storeItemCollection
StoreItemCollection

資料庫的結構。

傳回

DDL 指令碼,其會以 StoreItemCollection 參數內容為根據,並以與提供者資訊清單語彙基元對應的資料庫版本為目標,來建立結構描述物件。

備註

個別語句應該使用資料庫特定的 DDL 命令分隔符號來分隔。 預期產生的腳本會在具有足夠許可權的現有資料庫內容中執行,而且不應該包含命令來建立資料庫,但可能包含命令來建立架構和其他輔助物件,例如序列等等。

適用於