Editar

Compartilhar via


Set-AzSynapseSqlScript

Creates or updates a SQL script in a workspace.

Syntax

Set-AzSynapseSqlScript
   -WorkspaceName <String>
   [-Name <String>]
   -DefinitionFile <String>
   [-ResultLimit <Int32>]
   [-FolderPath <String>]
   [-Description <String>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSynapseSqlScript
   -WorkspaceName <String>
   -SqlPoolName <String>
   -SqlDatabaseName <String>
   [-Name <String>]
   -DefinitionFile <String>
   [-ResultLimit <Int32>]
   [-FolderPath <String>]
   [-Description <String>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSynapseSqlScript
   -WorkspaceObject <PSSynapseWorkspace>
   [-Name <String>]
   -DefinitionFile <String>
   [-ResultLimit <Int32>]
   [-FolderPath <String>]
   [-Description <String>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSynapseSqlScript
   -WorkspaceObject <PSSynapseWorkspace>
   -SqlPoolName <String>
   -SqlDatabaseName <String>
   [-Name <String>]
   -DefinitionFile <String>
   [-ResultLimit <Int32>]
   [-FolderPath <String>]
   [-Description <String>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-AzSynapseSqlScript cmdlet creates or updates a SQL script in a workspace.

Examples

Example 1

Set-AzSynapseSqlScript -WorkspaceName ContosoWorkspace -DefinitionFile "C:\\samples\\sqlscript.sql"

This command creates or updates a SQL script from SQL script file sqlscript.sql in the workspace named ContosoWorkspace.

Example 2

$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace
$ws | Set-AzSynapseSqlScript -DefinitionFile "C:\\samples\\sqlscript.sql"

This command creates or updates a SQL script from SQL script file sqlscript.sql in the workspace named ContosoWorkspace.

Example 3

Set-AzSynapseSqlScript -WorkspaceName ContosoWorkspace -DefinitionFile "C:\\samples\\sqlscript.sql"  -SqlPoolName Contososqlpool -SqlDatabaseName Contosodatabase

This command creates or updates a SQL script from SQL script file sqlscript.sql which connects to ContosoSqlPool and uses the database named Contosodatabase in the workspace named ContosoWorkspace.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefinitionFile

The SQL file path.

Type:String
Aliases:File
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Description

The description of the SQL script.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FolderPath

The folder that this SQL script is in. If specify a multi-level path such as [rootFolder/subFolder], the SqlScript will appear at the bottom level. If not specified, this SQL script will appear at the root level.

Type:String
Aliases:FolderName
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The sql script name.

Type:String
Aliases:SqlScriptName
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResultLimit

Limit of results, '-1' for no limit.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SqlDatabaseName

Which database the sql script is going to use.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SqlPoolName

Which sql pool the sql script is going to connect to.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceName

Name of Synapse workspace.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceObject

workspace input object, usually passed through the pipeline.

Type:PSSynapseWorkspace
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSSynapseWorkspace

Outputs

PSSqlScriptResource