SQL Server 데이터베이스를 생성하세요.
DB_SIZE_IN_MEGABYTES = 5
strDBServerName = "."
objSQLServer 설정==CreateObject("SQLDMO.SQLServer")
objSQLServer.LoginSecure==True
objSQLServer.Connect strDBServerName
objDB 설정=CreateObject("SQLDMO.Database")
Set objFG = CreateObject("SQLDMO.Filegroup")
Set objDBFile = CreateObject("SQLDMO.DBFile")
Set objLogFile = CreateObject("SQLDMO.LogFile")
objDB.Name = "ScriptingGuysTestDB"
objDBFile.Name = "ScriptingGuysTestDB_Data"
objDBFile.PhysicalName = "C:Program FilesMicrosoft SQL ServerMSSQLdataScriptingGuysTestDB_Data.MDF"
objDBFile.Size = DB_SIZE_IN_MEGABYTES
ob jDB.파일그룹(" PRIMARY").DBFiles.Add(objDBFile)
objSQLServer.Databases.Add(objDB)