List all the Databases on a SQL Server_javascript技巧
程序员文章站
2022-03-04 10:01:08
...
List all the Databases on a SQL Server.
Supported Platforms
SQL Server 2000
Yes
Script Code
strDBServerName = "."
Set objSQLServer = CreateObject("SQLDMO.SQLServer")
objSQLServer.LoginSecure = True
objSQLServer.Connect strDBServerName
Set colDatabases = objSQLServer.Databases
For Each objDatabase In colDatabases
WScript.Echo objDatabase.Name
Next
Supported Platforms
SQL Server 2000
Yes
Script Code
strDBServerName = "."
Set objSQLServer = CreateObject("SQLDMO.SQLServer")
objSQLServer.LoginSecure = True
objSQLServer.Connect strDBServerName
Set colDatabases = objSQLServer.Databases
For Each objDatabase In colDatabases
WScript.Echo objDatabase.Name
Next
上一篇: MySQL如何进行权限管理?
推荐阅读
-
sql 查询结果合并union all用法_数据库技巧
-
sql 查询结果合并union all用法_数据库技巧
-
List all the Databases on a SQL Server_javascript技巧
-
Stop SQL Server_javascript技巧
-
Sample script that displays all of the users in a given SQL Server DB_javascript技巧
-
Stop SQL Server_javascript技巧
-
List all the Databases on a SQL Server_javascript技巧
-
Sample script that displays all of the users in a given SQL Server DB_javascript技巧