SamplescriptthatdisplaysalloftheusersinagivenSQLServerDB_javascript技巧
來源:懂視網(wǎng)
責編:小采
時間:2020-11-27 20:37:21
SamplescriptthatdisplaysalloftheusersinagivenSQLServerDB_javascript技巧
SamplescriptthatdisplaysalloftheusersinagivenSQLServerDB_javascript技巧:Sample script that displays all of the users in a given SQL Server DB. Supported Platforms SQL Server 2000 Yes Script Code 代碼如下:strDBServerName = . strDBName = ScriptingGuysTestDB Set objSQLServer = CreateObject(SQLDMO.SQLServer) ob
導讀SamplescriptthatdisplaysalloftheusersinagivenSQLServerDB_javascript技巧:Sample script that displays all of the users in a given SQL Server DB. Supported Platforms SQL Server 2000 Yes Script Code 代碼如下:strDBServerName = . strDBName = ScriptingGuysTestDB Set objSQLServer = CreateObject(SQLDMO.SQLServer) ob
Sample script that displays all of the users in a given SQL Server DB.
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
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
SamplescriptthatdisplaysalloftheusersinagivenSQLServerDB_javascript技巧
SamplescriptthatdisplaysalloftheusersinagivenSQLServerDB_javascript技巧:Sample script that displays all of the users in a given SQL Server DB. Supported Platforms SQL Server 2000 Yes Script Code 代碼如下:strDBServerName = . strDBName = ScriptingGuysTestDB Set objSQLServer = CreateObject(SQLDMO.SQLServer) ob