Database.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Create(Boolean) |
Creates the database on the instance of SQL Server |
Create() |
Creates the database on the instance of SQL Server. |
Create(Boolean)
Creates the database on the instance of SQL Server
public void Create (bool forAttach);
member this.Create : bool -> unit
Public Sub Create (forAttach As Boolean)
Parameters
- forAttach
- Boolean
When true, will create the database by attaching existing files. There must be at least one FileGroup with a valid DataFile for the attach to succeed.
Examples
var databaseAttach = new Database(server, dbName); databaseAttach.FileGroups.Add(new FileGroup(databaseAttach, "PRIMARY")); databaseAttach.FileGroups["PRIMARY"].Files.Add(new DataFile(databaseAttach.FileGroups["PRIMARY"], primaryName, primaryFileName)); databaseAttach.Create(forAttach:true);
Applies to
Create()
Creates the database on the instance of SQL Server.
public void Create ();
abstract member Create : unit -> unit
override this.Create : unit -> unit
Public Sub Create ()