security - T-SQL schemata to organize code -
i have ms sql server database growing number of stored procedures , user defined functions , see need organize code better. idea split sps , functions on several schemata. default schema hold the sps called outside. api of database in other words. second schema hold internal code, should not called outside. same tables: contain "raw" data, hold precalculated data optimizations, ...
as have never used schema, have several questions:
- does make sense @ all?
- are there implications i'm not aware of? example performance issues when sp in schema using table in schema x?
- is possible restrict "outer world" use sps in schema? example: user allowed call objects in schema a, sps in schema still allowed use tables in schema b?
as question subjective, have marked "community wiki". hope ok.
yes, makes sense
no difference in performance if schemas have same owner (ownership chaining)
yes, permission schemas explicitly per client or have check internally
we uses schemas separate data, internals sps, internal functions, , sps per client.
one advantage grant permissions on schema not on objects, needed clarify in question, before started using them.
Comments
Post a Comment