Sample script that displays all of the users in a given SQL Server DB
2018-10-12 14:04
615 查看
Sample script that displays all of the users in a given SQL Server DB.
Supported Platforms
SQL Server 2000
Yes
Script Code
Supported Platforms
SQL Server 2000
Yes
Script Code
strDBServerName = "."
strDBName = "ScriptingGuysTestDB"
Set objSQLServer = CreateObject("SQLDMO.SQLServer")
objSQLServer.LoginSecure = True
objSQLServer.Connect strDBServerName
Set objDB = objSQLServer.Databases(strDBName)
Set colUsers = objDB.Users
For Each objUser In colUsers
WScript.Echo "User: " & objUser.Name
WScript.Echo "Login: " & objUser.Login
Next
相关文章推荐
- Sample script that displays all of the users in a given SQL Server DB
- Display the size of all tables in Sql Server 2005
- HOW TO: Change the Owner of a User-Defined Data Type That Is in Use in SQL Server 2000
- The DBMS that DB Query Analyzer users often access nearly covers all kinds of DBMS
- The DBMS that DB Query Analyzer users often access nearly covers all kinds of DBMS
- mysql sqlserver hibernate 有数据库关键字 You have an error in your SQL syntax; check the manual that corres
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection
- Error: The version of SQL Server in use does not support datatype 'datetime2
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
- ssh开发中插入数据时遇到 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
- How to troubleshoot the performance of Ad-Hoc queries in SQL Server [ZT-from MS]
- 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance
- Given constant integers x and t, write a function that takes no argument and returns true if the function has been called x number of times in last t secs.
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection
- 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
- Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path 解决(VS2010+IIS7.5)
- 错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve
- Error: The version of SQL Server in use does not support datatype 'datetime2'