Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Create Table so that user is the owner Expand / Collapse
Author
Message
Posted Thursday, November 27, 2008 11:03 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Thursday, November 17, 2011 4:09 PM
Points: 9,359, Visits: 8,864
J (11/27/2008)
Could you not just use a common table with an extra field like "OwnerID"to keep the data separate for each user and query with a SELECT FROM dbo.CommonTable WHERE OwnerID = ...

What you are really talking about is "Row-level security", which as a way of securing what is called "multi-tenant" databases and applications. Multi-tenancy has some specific requirements including that all tenants have the same schema/design, which is not stated or implied by the OP's post.


-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #609927
Posted Friday, November 28, 2008 6:28 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:14 AM
Points: 11,884, Visits: 22,833
Yikes! I'd say so. Upgrades to the data model must be entertaining.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #610311
Posted Friday, November 28, 2008 7:20 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Thursday, November 17, 2011 4:09 PM
Points: 9,359, Visits: 8,864
it's not too bad, Grant. The presumption is that all tenants are using the same software and schema, just that every data row is tagged with a Tenant ID and every access has to be filtered based on it. the filtering can easily be made bulletproof through the use of a universal layer of Views, and (owner)Schema security that forces all access to the tables through those views. (Hmm, maybe I should write an article on this ...) :)

Anyway, (design)schema upgrades are only slightly more complicated than a single-tenant environment.


-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #610335
Posted Friday, November 28, 2008 2:31 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:14 AM
Points: 11,884, Visits: 22,833
rbarryyoung (11/28/2008)
it's not too bad, Grant. The presumption is that all tenants are using the same software and schema, just that every data row is tagged with a Tenant ID and every access has to be filtered based on it. the filtering can easily be made bulletproof through the use of a universal layer of Views, and (owner)Schema security that forces all access to the tables through those views. (Hmm, maybe I should write an article on this ...) :)

Anyway, (design)schema upgrades are only slightly more complicated than a single-tenant environment.


[tapping foot] Waiting.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #610584
Posted Saturday, November 29, 2008 7:14 AM


One Orange Chip

One Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange ChipOne Orange Chip

Group: General Forum Members
Last Login: Today @ 11:09 AM
Points: 28,370, Visits: 22,161
rbarryyoung (11/28/2008)
(Hmm, maybe I should write an article on this ...) :)


{insert Jeapordy theme song here} :)


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #610695
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse