schemazen icon indicating copy to clipboard operation
schemazen copied to clipboard

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

Open thfrei opened this issue 5 years ago • 4 comments

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.

thfrei avatar Mar 06 '19 13:03 thfrei

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

timur4000 avatar Jul 23 '19 13:07 timur4000

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

thfrei avatar Jul 25 '19 06:07 thfrei

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

techvslife avatar Jan 27 '20 02:01 techvslife

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

spochiero avatar Dec 30 '20 16:12 spochiero