Skip to content

Add-ExtendedProperty

SYNOPSIS

Add or update an extended property in a SQL Server database.

SYNTAX

Add-ExtendedProperty [-SQLServer] <String> [-DBName] <String> [-ExtPropName] <String> [-ExtPropValue] <String>
 [<CommonParameters>]

DESCRIPTION

This function adds or updates an extended property in a specified SQL Server database. If the extended property already exists, it updates the value; otherwise, it creates a new extended property.

EXAMPLES

EXAMPLE 1

Add-ExtendedProperty -SQLServer "SQLInstance1" -DBName "TestDB" -ExtPropName "Description" -ExtPropValue "Test Database"

Adds or updates the extended property "Description" with the value "Test Database" in the "TestDB" database on "SQLInstance1".

EXAMPLE 2

Add-ExtendedProperty -SQLServer "SQLInstance2" -DBName "ProductionDB" -ExtPropName "Owner" -ExtPropValue "Admin"

Adds or updates the extended property "Owner" with the value "Admin" in the "ProductionDB" database on "SQLInstance2".

PARAMETERS

-SQLServer

The name of the SQL Server instance.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DBName

The name of the database where the extended property will be added or updated.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExtPropName

The name of the extended property to be added or updated.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExtPropValue

The value of the extended property to be added or updated.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES