'Schema' object use in SQL server code

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

'Schema' object use in SQL server code

whughes
I have recently come across Anchor Modeling and am very impressed and am trying to use it for my current project. I have noticed two things when generating SQL code for use with MS SQL Server:
1) The 'capsule' property is very usefully mapped to a 'schema object' in the generated code but the generated code does not create such objects if they do not exist before attempting to use them - it would be a useful addition at some point but not a priority.
2) The default capsule setting in the modeler does not appear to be used. When I have set this to something other than dbo it is not used for newly created objects and it is also not used when generating the 'internal' Anchor Modeling entities (e.g. the _Anchor view) which default to dbo.

I tend to use the 'schema object' to indicate working domains and to me dbo means that I forgot to allocate an entity properly .

Thank you for developing such a useful tool, it is so good as is that I wonder what version 1.0 would bring!
Reply | Threaded
Open this post in threaded view
|

Re: 'Schema' object use in SQL server code

roenbaeck
Administrator
Thanks for your input! The reason I left out the code for generating the schema is that in the large organisations that I have worked with, different people have maintained database security (schemas) and database implementations (an anchor model). I'll make a note that it could be useful nevertheless and make it an optional feature when generating code.

You are correct that it seems to neglect the default capsule setting for new objects. I don't know why, because when I implemented the feature I am sure that it worked. I'll investigate and fix this bug as soon as possible.
Reply | Threaded
Open this post in threaded view
|

Re: 'Schema' object use in SQL server code

whughes
I know that the schema is part of the SQL server security but in most of the places I've worked it's been used in the data warehouse to indicate a sort of 'domain' for the tables - typically 'stage', 'dim', 'fact' etc. I never really thought it odd to use it that way until now. It is useful though.

I'm glad to help with the 'bug report' so long as I don't seem to be demanding or complaining. This is a very useful tool and I'm grateful to have it and the whole anchor modelling approach. Thank you.