You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When backing up I get Msg 102, Level 15, State 1, Server mssql-server-1-lrjmh, Line 1 Incorrect syntax near '-'. Msg 319, Level 15, State 1, Server mssql-server-1-lrjmh, Line 1 Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
I tracked this to the backup.mssql.plugin line 19: sqlcmd -S ${_hostname}${_portArg} -U ${_username} -P ${_password} -Q "BACKUP DATABASE ${_database} TO DISK = N'${_fileName}' WITH NOFORMAT, NOINIT, SKIP, NOREWIND, NOUNLOAD, STATS = 10"
The database name should be wrapped in square [ ] brackets, as per Microsoft documentation.
When backing up I get
Msg 102, Level 15, State 1, Server mssql-server-1-lrjmh, Line 1 Incorrect syntax near '-'. Msg 319, Level 15, State 1, Server mssql-server-1-lrjmh, Line 1 Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
I tracked this to the
backup.mssql.plugin
line 19:sqlcmd -S ${_hostname}${_portArg} -U ${_username} -P ${_password} -Q "BACKUP DATABASE ${_database} TO DISK = N'${_fileName}' WITH NOFORMAT, NOINIT, SKIP, NOREWIND, NOUNLOAD, STATS = 10"
The database name should be wrapped in square [ ] brackets, as per Microsoft documentation.
https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-backup-and-restore-database?view=sql-server-ver15
Without it backup gets created but are empty.
Should be
sqlcmd -S ${_hostname}${_portArg} -U ${_username} -P ${_password} -Q "BACKUP DATABASE [${_database}] TO DISK = N'${_fileName}' WITH NOFORMAT, NOINIT, SKIP, NOREWIND, NOUNLOAD, STATS = 10"
Haven't tried restore yet, might also need to make changes to that.
The text was updated successfully, but these errors were encountered: