We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When creating a mssql_script resource that uses 'GO' in the script the resource fails to create.
The error is:
mssql_script.ecamap_setup: Creating... ╷ │ Error: Failed to execute SQL script │ │ with mssql_script.ecamap_setup, │ on 05_sql_database_setup.tf line 62, in resource "mssql_script" "setup": │ 62: resource "mssql_script" "setup" { │ │ mssql: Incorrect syntax near 'GO'. ╵
Any help?
The text was updated successfully, but these errors were encountered:
same here. I can confirm this behavior
tf plan to reproduce:
+ resource "mssql_script" "this" { + database_id = "1" + delete_script = "ALTER DATABASE [lock] SET CHANGE_TRACKING = OFF" + id = (known after apply) + read_script = "SELECT COUNT(*) AS [is_enabled] FROM sys.change_tracking_databases WHERE database_id=8" + state = { + "is_enabled" = "1" } + update_script = <<-EOT USE MASTER; DECLARE @database_name VARCHAR(256) DECLARE @sql_cmd VARCHAR(2000) SET @database_name = 'TEST' SET @sql_cmd = ' CREATE DATABASE ' + @database_name + ' COLLATE Latin1_General_CI_AS ' EXEC (@sql_cmd) GO EOT }
output:
│ 203: resource "mssql_script" "this" { │ │ mssql: Incorrect syntax near 'GO'.
Sorry, something went wrong.
GO is a batch separator and is not part of T-SQL, and is only interpreted by SSMS or other tools. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go?view=sql-server-ver16&redirectedfrom=MSDN
No branches or pull requests
When creating a mssql_script resource that uses 'GO' in the script the resource fails to create.
The error is:
Any help?
The text was updated successfully, but these errors were encountered: