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

SQL Server parsing issue when string literal is followed by as keyword without a space in between #2011

Closed
nkbysani opened this issue May 13, 2018 · 4 comments

Comments

@nkbysani
Copy link

@nkbysani nkbysani commented May 13, 2018

Which version and edition of Flyway are you using?

flyway-4.2.0

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

new versions are not supporting

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command-Line

Which database are you using (type & version)?

SQL SERVER 2012

Which operating system are you using?

windows

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

Invoke-Flyway -TargetDatabaseOption 5 -ServerName $serverName -Port $port -UserName $userName -Password $password -CommandToolPath $sqlCommandpath -ScriptsPath $scriptsPath -Environment $environment

What did you expect to see?

Few Stored procedures are not executing with the combination, when i kept the only one SP it is executing properly.

What did you see instead?

incorrect syntax near 'end'
incorrect syntax near 'GO'
like the above errors are coming , error coming with last statement mentioned in the script.

for example : if the last statement is ";".
error is coming as
incorrect syntax near ';'

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 13, 2018

Please post the smallest stored procedure that Flyway has trouble parsing.

@nkbysani
Copy link
Author

@nkbysani nkbysani commented May 14, 2018

when i kept only first SP uspDeleteGenericImportJournal , executing properly.
but after that SP what ever i mention as above not executing ...don't know why. please help.

@nkbysani
Copy link
Author

@nkbysani nkbysani commented May 14, 2018

I got the solution ..

Problem is in one SP the code is mentioned as '0'as 'Amount'. when i changed this to 0 as 'Amount' it is working fine.

so we should not mention integer values in single Quotation.

Thanks axelfontaine.

@nkbysani nkbysani closed this May 15, 2018
@axelfontaine axelfontaine added this to the Flyway 5.1.0 milestone May 17, 2018
@axelfontaine axelfontaine changed the title SP is not creating through flyway SQL Server. SQL Server parsing issue when string literal is followed by as keyword without a space in between May 17, 2018
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue May 17, 2018
axelfontaine added a commit that referenced this issue May 17, 2018
… by as keyword without a space in between
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 17, 2018

Thanks for reporting. This was indeed a parsing issue and it has now been fixed.

dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
…llowed by as keyword without a space in between
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants