UserProfile Property (SQL-DMO)

The UserProfile property returns a high-level role description for the Microsoft® SQL Server™ login or database user used by the current connection.

Applies To
Database Object SQLServer Object

Syntax

object.UserProfile

Part Description
object Expression that evaluates to an object in the Applies To list

Returns

For the Database object, interpret the UserProfile property using these values.

Constant Value Description
SQLDMODbUserProf_AllProfileBits 511 User has all specifiable database maintenance privilege
SQLDMODbUserProf_CreateDefault 32 User has CREATE DEFAULT permission
SQLDMODbUserProf_
CreateProcedure
8 User has CREATE PROCEDURE permission
SQLDMODbUserProf_CreateRule 128 User has CREATE RULE permission
SQLDMODbUserProf_CreateTable 2 User has CREATE TABLE permission
SQLDMODbUserProf_CreateView 4 User has CREATE VIEW permission
SQLDMODbUserProf_
DbNotAvailable
-1073741824 Unable to determine user permission due to offline or other error
SQLDMODbUserProf_DboLogin 1 User is a member of the db_owner role
SQLDMODbUserProf_DumpDatabase 16 User can back up data for the referenced database
SQLDMODbUserProf_
DumpTransaction
64 User can back up the transaction log of the referenced database
SQLDMODbUserProf_DumpTable 256 User can back up database data specifying a table as the backup unit
SQLDMODbUserProf_InaccessibleDb -2147483648 Referenced database is offline or is otherwise inaccessible
SQLDMODbUserProf_InvalidLogin 1073741824 Current connection login has no user privilege in the referenced database
SQLDMODbUserProf_None 0 User has no database modification or maintenance privilege

For the SQLServer object, interpret the UserProfile property using these values.

Constant Value Description
SQLDMOSrvUserProf_
AllProfileBits
7 Login has all specifiable SQL Server maintenance privilege
SQLDMOSrvUserProf_
CreateDatabase
2 Login has CREATE DATABASE permission
SQLDMOSrvUserProf_CreateXP 4 Login can execute sp_addextendedproc and sp_dropextendedproc (loading and unloading extended stored procedures)
SQLDMOSrvUserProf_None 0 Login has no SQL Server maintenance privilege
SQLDMOSrvUserProf_SaLogin 1 Login is a member of the sysadmin role

Remarks

SQL Server login and user privilege is enhanced in SQL Server version 7.0. Fixed server and database roles allow greater granularity in specifying SQL Server installation maintenance. For more information, see DatabaseRole Object and ServerRole Object.

Data Type

Long, enumerated

Modifiable

Read-only

Prototype (C/C++)

For the Database object:

HRESULT GetUserProfile(SQLDMO_DBUSERPROFILE_TYPE* pRetVal)

For the SQLServer object:

HRESULT GetUserProfile(SQLDMO_SRVUSERPROFILE_TYPE* pRetVal)

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.