schemazen
schemazen copied to clipboard
Error when trying to _script_ Database on MS SQL Server Standard 11.0.7001.0
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.
I have exactly the same error! MS SQL Server 2014 Developer Edition
I figure it has something to do with Server Versions. As of MS SQL Server 2016 (13.x) it seems to work.
As of MS SQL Server 2019, getting the same error!
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