use jscript Create a SQL Server database
2018-10-15 17:31
CreateaSQLServerdatabase.
复制代码 代码如下:
DB_SIZE_IN_MEGABYTES=5
strDBServerName=.
SetobjSQLServer=CreateObject(SQLDMO.SQLServer)
objSQLServer.LoginSecure=True
SetobjDB=CreateObject(SQLDMO.Database)
SetobjFG=CreateObject(SQLDMO.Filegroup)
SetobjDBFile=CreateObject(SQLDMO.DBFile)
SetobjLogFile=CreateObject(SQLDMO.LogFile)
objDBFile.Name=ScriptingGuysTestDB_Data
objDBFile.PhysicalName=C:\ProgramFiles\MicrosoftSQLServer\MSSQL\data\ScriptingGuysTestDB_Data.MDF
objDBFile.Size=DB_SIZE_IN_MEGABYTES
objDB.FileGroups(PRIMARY).DBFiles.Add(objDBFile)
objSQLServer.Databases.Add(objDB)
文章标题:use jscript Create a SQL Server database
文章链接:http://soscw.com/index.php/essay/18691.html