Multi-Tenant Hierachical Framework w/ SQL Server

Home / Multi-Tenant Hierachical Framework w/ SQL Server

  • Store hierachical organization data
  • All tables in a multi-tenant database would have a [OrganizationName] field.
  • The Organization table stores the hierarchical relationships for each organization.
  • SQL Server 2008+ supports the hierarchyID data type (not used here), which would make some of the hierarchical manipulations easier. I needed to support SQL Server 2005 as well, so I didn’t have the pleasure.

[C#] version of [dbo].[spSetContext]