Remove-SqlDatabaseRole

Removes a database role from a database.

Syntax

Remove-SqlDatabaseRole [[-sqlserver] <Object>] [-dbname] <Object> [-name] <String> [<CommonParameters>]

Detailed Description

The Remove-SqlDatabaseRole function removes a new database role from the specified database.

Related Commands

* Remove-SqlDatabaseRole

Parameters

Name Description Required? Pipeline Input Default Value
sqlserver    false  false   
dbname    true  false   
name    true  false   

Input Type

None You cannot pipe objects to Remove-SqlDatabaseRole

Return Values

None This function does not generate any output.

Examples

EXAMPLE 1

Remove-SqlDatabaseRole "Z002\sql2k8" "pubs" "TestPSUnitDBRole"
This command Removes the TestPSUnitDBRole role from the pubs database.

EXAMPLE 2

$database = Get-SqlDatabase "Z002\sql2k8" "pubs"
Remove-SqlDatabaseRole -dbname $database -name "TestPSUnitDBRole"
This command Removes the TestPSUnitDBRole role from the pubs database.