-
Notifications
You must be signed in to change notification settings - Fork 102
Invoke D365SqlScript
Execute a SQL Script or a SQL Command
Invoke-D365SqlScript [-FilePath] <String> [-DatabaseServer <String>] [-DatabaseName <String>]
[-SqlUser <String>] [-SqlPwd <String>] [-TrustedConnection <Boolean>] [-EnableException] [-NoPooling]
[<CommonParameters>]
Invoke-D365SqlScript [-Command] <String> [-DatabaseServer <String>] [-DatabaseName <String>]
[-SqlUser <String>] [-SqlPwd <String>] [-TrustedConnection <Boolean>] [-EnableException] [-NoPooling]
[<CommonParameters>]
Execute a SQL Script or a SQL Command against the D365FO SQL Server database
Invoke-D365SqlScript -FilePath "C:\temp\d365fo.tools\DeleteUser.sql"
This will execute the "C:\temp\d365fo.tools\DeleteUser.sql" against the registered SQL Server on the machine.
Invoke-D365SqlScript -Command "DELETE FROM SALESTABLE WHERE RECID = 123456789"
This will execute "DELETE FROM SALESTABLE WHERE RECID = 123456789" against the registered SQL Server on the machine.
Invoke-D365SqlScript -Command "DELETE FROM SALESTABLE WHERE RECID = 123456789" -NoPooling
This will execute "DELETE FROM SALESTABLE WHERE RECID = 123456789" against the registered SQL Server on the machine. It will not use connection pooling.
Path to the file containing the SQL Script that you want executed
Type: String
Parameter Sets: FilePath
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
SQL command that you want executed
Type: String
Parameter Sets: Command
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The name of the database server
If on-premises or classic SQL Server, use either short name og Fully Qualified Domain Name (FQDN).
If Azure use the full address to the database server, e.g. server.database.windows.net
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $Script:DatabaseServer
Accept pipeline input: False
Accept wildcard characters: False
The name of the database
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $Script:DatabaseName
Accept pipeline input: False
Accept wildcard characters: False
The login name for the SQL Server instance
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $Script:DatabaseUserName
Accept pipeline input: False
Accept wildcard characters: False
The password for the SQL Server user
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $Script:DatabaseUserPassword
Accept pipeline input: False
Accept wildcard characters: False
Switch to instruct the cmdlet whether the connection should be using Windows Authentication or not
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This parameters disables user-friendly warnings and enables the throwing of exceptions This is less user friendly, but allows catching exceptions in calling scripts
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Should the connection use connection pooling or not
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Author: Mötz Jensen (@splaxi)
Author: Caleb Blanchard (@daxcaleb)
- Install as a non-Administrator
- Install as a Administrator
- Import d365fo.tools module
- List available commands from d365fo.tools module
- Get help content for a command
- Start, Stop and List services
- Import users into the D365FO environment
- Import external users into the D365FO environment
- Enable users in the D365FO environment
- Update users in the D365FO environment
- Provision D365FO environment to new Azure AD tenant
- Import a bacpac file into a Tier1 environment
- List modules / models
- Compile module
- Install AzCopy
- Install SqlPackage
- Install Nuget
- Speed up LCS download via AzCopy
- Download latest bacpac from LCS via AzCopy
- Register NuGet source
- Configure Azure Logic App
- Fix AzureStorageConfig
- Run a runnable class
- Update users in environment
- Work with Azure Storage Account
- Work with packages, resource label files, language and lables
- Working with the different D365 services