0
Fixed

SQL SCRIPT CREATES "ON PRIMARY" (SQL SERVER)

Craig Wilkinson 9 years ago updated by Rafał Strzaliński (Senior Engineer) 9 years ago 8
If you build a create table script for SQL Server, it fails to run; "ON PRIMARY" is added at the end of all indexes, tables, etc.  - since "PRIMARY" is a reserved word, the script won't work.

Changing the script from "ON PRIMARY" to "ON [PRIMARY]" fixes the issue; could this be done at point of generation?
Not a bug
We would like to keep the script generation mechanism as simple as possible. Simplicity is our general idea. Adding an extra condition will make it more complex,  less obvious, and finally it'll become source of frustration for our users and us. 

I recommend  you should simply put  "[PRIMARY]" in the text field as in the picture. This is solution not a workaround :)


Hi Rafal, no offence, but it's a pretty poor solution! As standard, any table I create is allocated to ON PRIMARY; to then make the user go in an change everything to [ON PRIMARY] feels a little too much like additional effort for the user.

Also, I can't see an option to change this for indecies..? They're output as ON PRIMARY too... Perhaps an option to set defaults is required?
Planned
Hi Craig, 
There is an option to set defaults but doesn't work as it should be. I've planned to give an instruction but found a bug. grrr. I think it will be fixed in the next week. Please be patient and sorry for  inconvenience. 

Fantastic, thanks for your help!
The fix is on production already. 

Here is a short instruction how to set default values.

1. Go to the model details page (Control-m)



2.  Click "Additional Properties" on the right side

3. You'll get that screen:



4. Change default values.
5. Back to the diagram
6. Add new tables. Every new table will have "on clause" set.


Hope this helps. Sorry for delay.