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

Error when trying to _script_ Database on MS SQL Server Standard 11.0.7001.0 #166

Open
thfrei opened this issue Mar 6, 2019 · 4 comments

Comments

@thfrei
Copy link

thfrei commented Mar 6, 2019

Error description

I try to script an export of a database as seen below. However this fails for unknown reasons:

PS C:\apps> .\SchemaZen.exe script --verbose --server=SERVER --database=MES20 --user=USER--pass=PW --scriptDir=c:\temp
\MES20 -o
Loading database schema...

Must declare the scalar variable "@roleName".
Must declare the scalar variable "@roleName".
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.
Incorrect syntax near '+'.

'Script' - Generate scripts for the specified database.

Expected usage: SchemaZen.exe Script <options>
<...

PS C:\apps>

-v Does not give me more information unfortunately.

The Server properties are below:

Edition	ProductVersion	ProductLevel
Standard Edition (64-bit)	11.0.7001.0	SP4

Note: When using an SQL Express Server (The Same DB MES20 was backed up from the server and restored to SQL Express) it works.

It might be related to #141 however, I am not using SQL Express in this case, and I get another error.

Any suggestions?

Please let me know, if I can give you more details.
Thank you.

@timur4000
Copy link

I have exactly the same error!
MS SQL Server 2014 Developer Edition

@thfrei
Copy link
Author

thfrei commented Jul 25, 2019

I figure it has something to do with Server Versions. As of MS SQL Server 2016 (13.x) it seems to work.

@techvslife
Copy link

As of MS SQL Server 2019, getting the same error!

@spochiero
Copy link

pb in database.cs
the variable is declared like this : @RoleName
and not like this : @roleName

in your case, the SQL Server classement is case sensitive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants