-
Notifications
You must be signed in to change notification settings - Fork 140
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
Script for CONSTRAINT in tables folder SOMETIMES generates with an SQL Syntax error!!! #197
Comments
Interesting, I found another tool (dbForge) that produces SIMILAR OUTPUT, but it PASSES the test, but looks WRONG!
Notice that the number of ] just seems wrong! and that passes! Whereas SchemaZen appears to balance them out, and that screws them up! Somewhere, someone coded the "(NULL)" default value into the table, which creates a constraint. FWIW: It turns out that a TOOL used to migrate the DB years ago, probably broke this in generating it. At least that's the constraint_name from the query:
|
This might be some kind of "security" issue.
In the tables\Events.sql :
[bigpicture] nvarchar NULL
CONSTRAINT [[dbo].[Events]bigpictureDefault] DEFAULT (NULL),
[story] nvarchar NULL
CONSTRAINT [[dbo].[Events]storyDefault] DEFAULT (NULL),
on my machine it does it correctly (SQLEXPRESS) :
[bigpicture] nvarchar NULL
CONSTRAINT [bigpictureDefault] DEFAULT (NULL),
[story] nvarchar NULL
CONSTRAINT [storyDefault] DEFAULT (NULL),
-- I double checked that I have the same EXE
-- I wish HELP would show the version :-)
-- Also, it would be great if you scripted a TESTALL.SQL (switch)
SET NOEXEC ON
:r "<filename.sql>" -- for each file you generate!!!
I did it manually using this command: [in the hopes someone finds it useful]
for /R server\ %x in (*.sql) do @echo :r "%x"
and found 3 ERRORS, ALL the same flavor!
And I found 2 of those errors on MY tables. Very Strange...
The text was updated successfully, but these errors were encountered: