Set‑SqlDscDatabaseProperty - dsccommunity/SqlServerDsc GitHub Wiki
Sets properties of a database in a SQL Server Database Engine instance.
Set-SqlDscDatabaseProperty -ServerObject <Server> -Name <String> [-Refresh]
[-AcceleratedRecoveryEnabled <Boolean>] [-AnsiNullDefault <Boolean>] [-AnsiNullsEnabled <Boolean>]
[-AnsiPaddingEnabled <Boolean>] [-AnsiWarningsEnabled <Boolean>] [-ArithmeticAbortEnabled <Boolean>]
[-AutoClose <Boolean>] [-AutoCreateIncrementalStatisticsEnabled <Boolean>]
[-AutoCreateStatisticsEnabled <Boolean>] [-AutoShrink <Boolean>] [-AutoUpdateStatisticsAsync <Boolean>]
[-AutoUpdateStatisticsEnabled <Boolean>] [-BrokerEnabled <Boolean>] [-ChangeTrackingAutoCleanUp <Boolean>]
[-ChangeTrackingEnabled <Boolean>] [-CloseCursorsOnCommitEnabled <Boolean>]
[-ConcatenateNullYieldsNull <Boolean>] [-DatabaseOwnershipChaining <Boolean>]
[-DataRetentionEnabled <Boolean>] [-DateCorrelationOptimization <Boolean>] [-EncryptionEnabled <Boolean>]
[-HonorBrokerPriority <Boolean>] [-IsFullTextEnabled <Boolean>] [-IsLedger <Boolean>]
[-IsParameterizationForced <Boolean>] [-IsReadCommittedSnapshotOn <Boolean>] [-IsSqlDw <Boolean>]
[-IsVarDecimalStorageFormatEnabled <Boolean>] [-LegacyCardinalityEstimation <Boolean>]
[-LegacyCardinalityEstimationForSecondary <Boolean>] [-LocalCursorsDefault <Boolean>]
[-NestedTriggersEnabled <Boolean>] [-NumericRoundAbortEnabled <Boolean>] [-ParameterSniffing <Boolean>]
[-ParameterSniffingForSecondary <Boolean>] [-QueryOptimizerHotfixes <Boolean>]
[-QueryOptimizerHotfixesForSecondary <Boolean>] [-QuotedIdentifiersEnabled <Boolean>] [-ReadOnly <Boolean>]
[-RecursiveTriggersEnabled <Boolean>] [-RemoteDataArchiveEnabled <Boolean>]
[-RemoteDataArchiveUseFederatedServiceAccount <Boolean>] [-TemporalHistoryRetentionEnabled <Boolean>]
[-TransformNoiseWords <Boolean>] [-Trustworthy <Boolean>] [-ChangeTrackingRetentionPeriod <Int32>]
[-DefaultFullTextLanguage <Int32>] [-DefaultLanguage <Int32>] [-MaxDop <Int32>] [-MaxDopForSecondary <Int32>]
[-MirroringRedoQueueMaxSize <Int32>] [-MirroringTimeout <Int32>] [-TargetRecoveryTime <Int32>]
[-TwoDigitYearCutoff <Int32>] [-MaxSizeInBytes <Double>] [-Collation <String>]
[-FilestreamDirectoryName <String>] [-MirroringPartner <String>] [-MirroringPartnerInstance <String>]
[-MirroringWitness <String>] [-PersistentVersionStoreFileGroup <String>] [-PrimaryFilePath <String>]
[-RemoteDataArchiveCredential <String>] [-RemoteDataArchiveEndpoint <String>]
[-RemoteDataArchiveLinkedServer <String>] [-RemoteDatabaseName <String>]
[-ChangeTrackingRetentionPeriodUnits <RetentionPeriodUnits>] [-CompatibilityLevel <CompatibilityLevel>]
[-ContainmentType <ContainmentType>] [-DelayedDurability <DelayedDurability>]
[-FilestreamNonTransactedAccess <FilestreamNonTransactedAccessType>]
[-MirroringSafetyLevel <MirroringSafetyLevel>] [-PageVerify <PageVerify>] [-RecoveryModel <RecoveryModel>]
[-UserAccess <DatabaseUserAccess>] [-Force] [-PassThru] [-WhatIf]
[-Confirm] [<CommonParameters>]
Set-SqlDscDatabaseProperty -DatabaseObject <Database> [-AcceleratedRecoveryEnabled <Boolean>]
[-AnsiNullDefault <Boolean>] [-AnsiNullsEnabled <Boolean>] [-AnsiPaddingEnabled <Boolean>]
[-AnsiWarningsEnabled <Boolean>] [-ArithmeticAbortEnabled <Boolean>] [-AutoClose <Boolean>]
[-AutoCreateIncrementalStatisticsEnabled <Boolean>] [-AutoCreateStatisticsEnabled <Boolean>]
[-AutoShrink <Boolean>] [-AutoUpdateStatisticsAsync <Boolean>] [-AutoUpdateStatisticsEnabled <Boolean>]
[-BrokerEnabled <Boolean>] [-ChangeTrackingAutoCleanUp <Boolean>] [-ChangeTrackingEnabled <Boolean>]
[-CloseCursorsOnCommitEnabled <Boolean>] [-ConcatenateNullYieldsNull <Boolean>]
[-DatabaseOwnershipChaining <Boolean>] [-DataRetentionEnabled <Boolean>]
[-DateCorrelationOptimization <Boolean>] [-EncryptionEnabled <Boolean>] [-HonorBrokerPriority <Boolean>]
[-IsFullTextEnabled <Boolean>] [-IsLedger <Boolean>] [-IsParameterizationForced <Boolean>]
[-IsReadCommittedSnapshotOn <Boolean>] [-IsSqlDw <Boolean>] [-IsVarDecimalStorageFormatEnabled <Boolean>]
[-LegacyCardinalityEstimation <Boolean>] [-LegacyCardinalityEstimationForSecondary <Boolean>]
[-LocalCursorsDefault <Boolean>] [-NestedTriggersEnabled <Boolean>] [-NumericRoundAbortEnabled <Boolean>]
[-ParameterSniffing <Boolean>] [-ParameterSniffingForSecondary <Boolean>] [-QueryOptimizerHotfixes <Boolean>]
[-QueryOptimizerHotfixesForSecondary <Boolean>] [-QuotedIdentifiersEnabled <Boolean>] [-ReadOnly <Boolean>]
[-RecursiveTriggersEnabled <Boolean>] [-RemoteDataArchiveEnabled <Boolean>]
[-RemoteDataArchiveUseFederatedServiceAccount <Boolean>] [-TemporalHistoryRetentionEnabled <Boolean>]
[-TransformNoiseWords <Boolean>] [-Trustworthy <Boolean>] [-ChangeTrackingRetentionPeriod <Int32>]
[-DefaultFullTextLanguage <Int32>] [-DefaultLanguage <Int32>] [-MaxDop <Int32>] [-MaxDopForSecondary <Int32>]
[-MirroringRedoQueueMaxSize <Int32>] [-MirroringTimeout <Int32>] [-TargetRecoveryTime <Int32>]
[-TwoDigitYearCutoff <Int32>] [-MaxSizeInBytes <Double>] [-Collation <String>]
[-FilestreamDirectoryName <String>] [-MirroringPartner <String>] [-MirroringPartnerInstance <String>]
[-MirroringWitness <String>] [-PersistentVersionStoreFileGroup <String>] [-PrimaryFilePath <String>]
[-RemoteDataArchiveCredential <String>] [-RemoteDataArchiveEndpoint <String>]
[-RemoteDataArchiveLinkedServer <String>] [-RemoteDatabaseName <String>]
[-ChangeTrackingRetentionPeriodUnits <RetentionPeriodUnits>] [-CompatibilityLevel <CompatibilityLevel>]
[-ContainmentType <ContainmentType>] [-DelayedDurability <DelayedDurability>]
[-FilestreamNonTransactedAccess <FilestreamNonTransactedAccessType>]
[-MirroringSafetyLevel <MirroringSafetyLevel>] [-PageVerify <PageVerify>] [-RecoveryModel <RecoveryModel>]
[-UserAccess <DatabaseUserAccess>] [-Force] [-PassThru] [-WhatIf]
[-Confirm] [<CommonParameters>]
This command sets properties of a database in a SQL Server Database Engine instance.
The command supports a comprehensive set of settable database properties including configuration settings, security properties, performance settings, and state information. Users can set one or multiple properties in a single command execution.
All properties correspond directly to Microsoft SQL Server Management Objects (SMO) Database class properties and support the same data types and values as the underlying SMO implementation.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
Set-SqlDscDatabaseProperty -ServerObject $serverObject -Name 'MyDatabase' -RecoveryModel 'Simple'
Sets the recovery model of the database named MyDatabase to Simple.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
$databaseObject = $serverObject | Get-SqlDscDatabase -Name 'MyDatabase'
Set-SqlDscDatabaseProperty -DatabaseObject $databaseObject -ReadOnly $false -AutoClose $false
Sets multiple database properties at once using a database object.
$serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance'
Set-SqlDscDatabaseProperty -ServerObject $serverObject -Name 'MyDatabase' -CompatibilityLevel 'Version160' -Trustworthy $false -Force
Sets the compatibility level and trustworthy property of the database without prompting for confirmation.
Specifies whether Accelerated Database Recovery (ADR) is enabled for the database.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether new columns allow NULL by default unless explicitly specified (when ON).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether comparisons to NULL follow ANSI SQL behavior (when ON, x = NULL yields UNKNOWN).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether padding for variable-length columns (e.g., CHAR/VARCHAR) follows ANSI rules.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether ANSI warnings are generated for certain conditions (when ON, e.g., divide by zero).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether a query is terminated when an overflow or divide-by-zero error occurs.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether the database closes after the last user exits.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether creation of incremental statistics on partitioned tables is allowed.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether single-column statistics are automatically created for query optimization.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether the database automatically shrinks files when free space is detected.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether statistics are updated asynchronously, allowing queries to proceed with old stats.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether statistics are automatically updated when they are out-of-date.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether Service Broker is enabled for the database.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether automatic cleanup of change tracking information is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether change tracking is enabled for the database.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the retention period value for change tracking information.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the units for the retention period (e.g., DAYS, HOURS).
Type: RetentionPeriodUnits
Parameter Sets: (All)
Aliases:
Accepted values: None, Minutes, Hours, Days
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether open cursors are closed when a transaction is committed.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the default collation for the database.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the database compatibility level (affects query processor behavior and features).
Type: CompatibilityLevel
Parameter Sets: (All)
Aliases:
Accepted values: Version60, Version65, Version70, Version80, Version90, Version100, Version110, Version120, Version130, Version140, Version150, Version160, Version170
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether concatenation with NULL results in NULL (when ON).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the containment level of the database (NONE or PARTIAL).
Type: ContainmentType
Parameter Sets: (All)
Aliases:
Accepted values: None, Partial
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the database object to modify (from Get-SqlDscDatabase).
Type: Database
Parameter Sets: DatabaseObjectSet
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSpecifies whether ownership chaining across objects within the database is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether SQL Server data retention policy is enabled at the database level.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether date correlation optimization is enabled to speed up temporal joins.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the LCID of the default full-text language.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the ID of the default language for the database.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the delayed durability setting for the database (DISABLED, ALLOWED, FORCED).
Type: DelayedDurability
Parameter Sets: (All)
Aliases:
Accepted values: Disabled, Allowed, Forced
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether Transparent Data Encryption (TDE) is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the directory name used for FILESTREAM data.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the FILESTREAM access level for non-transactional access.
Type: FilestreamNonTransactedAccessType
Parameter Sets: (All)
Aliases:
Accepted values: Off, ReadOnly, Full
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies that the database should be modified without any confirmation.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether honoring Service Broker conversation priority is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether full-text search is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether the database is a ledger database.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether forced parameterization is enabled for the database.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether READ_COMMITTED_SNAPSHOT isolation is ON.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether the database is a SQL Data Warehouse database.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether vardecimal compression is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether the legacy cardinality estimator is enabled for the primary.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether the legacy cardinality estimator is enabled for secondary replicas.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether cursors are local by default instead of global (when ON).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the MAXDOP database-scoped configuration for primary replicas.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the MAXDOP database-scoped configuration for secondary replicas.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the maximum size of the database in bytes.
Type: Double
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the mirroring partner server name (if configured).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the mirroring partner instance name (if configured).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the redo queue maximum size for mirroring/AGs.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the mirroring safety level (FULL/Off/HighPerformance).
Type: MirroringSafetyLevel
Parameter Sets: (All)
Aliases:
Accepted values: None, Unknown, Off, Full
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the timeout in seconds for mirroring sessions.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the mirroring witness server (if used).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the name of the database to modify.
Type: String
Parameter Sets: ServerObjectSet
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether triggers are allowed to fire other triggers (nested triggers).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether an error is raised on loss of precision due to rounding (when ON).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the page verification setting (NONE, TORN_PAGE_DETECTION, CHECKSUM).
Type: PageVerify
Parameter Sets: (All)
Aliases:
Accepted values: None, TornPageDetection, Checksum
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether parameter sniffing behavior is enabled on the primary.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether parameter sniffing is enabled on secondary replicas.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies that the database object should be returned after modification.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the filegroup used for the Persistent Version Store (PVS).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the path of the primary data files directory.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether query optimizer hotfixes are enabled on the primary.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether query optimizer hotfixes are enabled on secondary replicas.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether identifiers can be delimited by double quotes (when ON).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether the database is in read-only mode.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the database recovery model (FULL, BULK_LOGGED, SIMPLE).
Type: RecoveryModel
Parameter Sets: (All)
Aliases:
Accepted values: Full, BulkLogged, Simple
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether a trigger is allowed to fire itself recursively.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies that the ServerObject's databases should be refreshed before trying to get the database object. This is helpful when databases could have been modified outside of the ServerObject, for example through T-SQL. But on instances with a large amount of databases it might be better to make sure the ServerObject is recent enough.
This parameter is only used when setting properties using ServerObject and Name parameters.
Type: SwitchParameter
Parameter Sets: ServerObjectSet
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the credential name for Stretch Database/remote data archive.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether Stretch Database (remote data archive) is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the endpoint URL for remote data archive.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the linked server used by remote data archive.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether to use federated service account for remote data archive.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the remote database name for remote data archive.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies current server connection object.
Type: Server
Parameter Sets: ServerObjectSet
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the target recovery time (seconds) for indirect checkpointing.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether automatic cleanup of system-versioned temporal history is enabled.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies how full-text noise word behavior is controlled during queries.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies whether implicit access to external resources by modules is allowed (use with caution).
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the two-digit year cutoff used for date conversion.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the database user access mode (MULTI_USER, RESTRICTED_USER, SINGLE_USER).
Type: DatabaseUserAccess
Parameter Sets: (All)
Aliases:
Accepted values: Multiple, Single, Restricted
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
The following database properties are read-only after creation and cannot be modified using this command:
-
CatalogCollation: The catalog-level collation used for metadata and temporary objects. This property is marked as ReadOnlyAfterCreation in the SMO Database class and can only be set during database creation (e.g., using
New-SqlDscDatabaseor CREATE DATABASE statements). -
DatabaseSnapshotBaseName: The base name of the source database for a database snapshot. This property is marked as ReadOnlyAfterCreation in the SMO Database class. To create database snapshots, use the
New-SqlDscDatabaseSnapshotorNew-SqlDscDatabasecommand with the-DatabaseSnapshotBaseNameparameter.
There are some database properties that require method calls instead of direct
property assignment and will be supported through separate commands, e.g.
Set-SqlDscDatabaseDefaultFileGroup.
Azure SQL Database service tier and service objective changes should be managed
using Azure management cmdlets (e.g., Set-AzSqlDatabase with -Edition and
-RequestedServiceObjectiveName parameters) rather than through SMO.