Skip to content
New issue

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

"Incorrect syntax near '-'" when database name contains - #60

Closed
rdagumampan opened this issue Feb 3, 2020 · 1 comment
Closed

"Incorrect syntax near '-'" when database name contains - #60

rdagumampan opened this issue Feb 3, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@rdagumampan
Copy link
Owner

choco install yuniql --version 0.328.0

docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=P@ssw0rd!" -p 1400:1433 -d mcr.microsoft.com/mssql/server:2017-latest
SETX YUNIQL_CONNECTION_STRING "Server=localhost,1400;Database=yuniqldb-dev;User Id=SA;Password=P@ssw0rd!"

git clone https://github.com/rdagumampan/yuniql.git c:\temp\yuniql-cli
cd c:\temp\yuniql-cli\samples\basic-sqlserver-sample
Microsoft Windows [Version 10.0.18362.592]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\temp\yuniql-cli\samples\basic-sqlserver-sample>yuniql run -a
INF   2020-02-03T19:19:40.7498554Z   Started migration from C:\temp\yuniql-cli\samples\basic-sqlserver-sample.
INF   2020-02-03T19:19:40.8011159Z   No explicit target version requested. We'll use latest available locally v0.00 on C:\temp\yuniql-cli\samples\basic-sqlserver-sample.
INF   2020-02-03T19:19:41.6972951Z   Target database does not exist. Creating database yuniqldb-dev on localhost,1400.
ERR   2020-02-03T19:19:41.9200079Z   Failed to execute run function. Target database will be rolled back to its previous state.
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '-'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Yuniql.Core.ConnectionExtensions.ExecuteNonQuery(IDbConnection connection, String commandText, Nullable`1 commandTimeout, IDbTransaction transaction, ITraceService traceService)
   at Yuniql.Core.ConfigurationDataService.CreateDatabase(Nullable`1 commandTimeout)
   at Yuniql.Core.MigrationService.Run(String workingPath, String targetVersion, Nullable`1 autoCreateDatabase, List`1 tokenKeyPairs, Nullable`1 verifyOnly, String delimiter, Nullable`1 commandTimeout, Nullable`1 batchSize)
   at Yuniql.CLI.CommandLineService.RunMigration(RunOption opts)
ClientConnectionId:ab75fba2-0d22-4c42-9a19-7f34c71fabe4
Error Number:102,State:1,Class:15
Unhandled exception. System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '-'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Yuniql.Core.ConnectionExtensions.ExecuteNonQuery(IDbConnection connection, String commandText, Nullable`1 commandTimeout, IDbTransaction transaction, ITraceService traceService)
   at Yuniql.Core.ConfigurationDataService.CreateDatabase(Nullable`1 commandTimeout)
   at Yuniql.Core.MigrationService.Run(String workingPath, String targetVersion, Nullable`1 autoCreateDatabase, List`1 tokenKeyPairs, Nullable`1 verifyOnly, String delimiter, Nullable`1 commandTimeout, Nullable`1 batchSize)
   at Yuniql.CLI.CommandLineService.RunMigration(RunOption opts)
   at Yuniql.Program.<>c__DisplayClass0_0.<Main>b__1(RunOption opts)
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,T4,T5,T6,T7,T8,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 parsedFunc4, Func`2 parsedFunc5, Func`2 parsedFunc6, Func`2 parsedFunc7, Func`2 parsedFunc8, Func`2 notParsedFunc)
   at Yuniql.Program.Main(String[] args)
ClientConnectionId:ab75fba2-0d22-4c42-9a19-7f34c71fabe4
Error Number:102,State:1,Class:15

C:\temp\yuniql-cli\samples\basic-sqlserver-sample>
@rdagumampan rdagumampan added the bug Something isn't working label Feb 3, 2020
@rdagumampan rdagumampan self-assigned this Feb 3, 2020
@rdagumampan rdagumampan changed the title Error "Incorrect syntax near '-'" when database name contains - "Incorrect syntax near '-'" when database name contains - Feb 3, 2020
@rdagumampan
Copy link
Owner Author

Fixed: 7fdeade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant