Sample script that displays all of the users in a given SQL Server DB
2007-06-16 00:00
609 查看
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
- HOW TO: Change the Owner of a User-Defined Data Type That Is in Use in SQL Server 2000
- Display the size of all tables in Sql Server 2005
- 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
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection
- SQL Interview Preparation (in the context of MS SQL Server)
- The Maximum Number of Bytes Per Row in SQL Server 2000 -- 8060.
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- The difference between Union & Union All in SQL Server/pOSTGRESQL
- SQL Error: 1064, SQLState: 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- 插入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
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- Error: The version of SQL Server in use does not support datatype 'datetime2'
- [转]How can I list all foreign keys referencing a given table in SQL Server?
- Finding the causes of poor performance in SQL Server
- DB太大?一键帮你收缩所有DB文件大小(Shrink Files for All Databases in SQL Server)
- 创建存储过程错误(已解决):Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ver