Edit me

For Create Tables

Point 1. Primary Key must be combination with TenantID and key field.

 1 (i). All PK should have TenantID+EntityID as primary key. But in large tables, use EntityID+TenantID as primary key to improve update query performance. 

 1 (ii). If EntityID is integer, and used in other tables, Primary key = EntityID+TenantID. 

 1 (iii). If EntityID is integer, and not used in other tables, Primary key = EntityID and EntityID is guid, Primary key = EntityID OK

Point 2. TenantID must have default value & using this for default value rls.fncGetTenantID ()

Point 3. Frist letter of all columns should be Capital and ID fields to be appear on top.

Point 4. Must be added require relationship for ID fields with combination TenantID like as FK.

 4 (i). All FK should have TenantID+EntityID as primary key. But in large tables, use EntityID+TenantID as primary key to improve update query performance.

Point 5. Add Unique Constraints: All unique indexes should have TenantID in it as last column.

Point 6. Applied proper Indexes for ID’s field which are included in Join & where Conditions in functions & views and all indexes apart from primary index should not have TenantID column.

Point 7. Created table should be included in tenantAccessPolicy (If it’s Tenant Based)

Point 8. Assigned require permission to roles

 8 (i). Go to Database->Right click on Table and select Properties.

 8 (ii). Select Permissions  and click on Search button and click Browse button.

 8 (iii). After click on Browse button Browse window open and marked on require objects(Roles, Users) and click on Ok.

 8 (iv). Now we can assigned require permission(Select/Delete/Insert/Update) click on Ok.

Point 9. Synced with other Database where Table is require.