Should they all be owned by sa or should I break them out? Like the WebAppDB1 is owned by BJohnson10, who is works mainly with this db as he is lead developer of the Web App that uses the database.
If you need any additional info, reply.
Thank You in advance!!!Hi Unotech
This is a great question, unfortunately there isnt a simple answer.
If you create objects when logged in as sa, then they by default become the porperty of dbo. This seems to be what happens in most databases, and isnt a problem.
If you have other users logging on, and creating objects from their own accounts, then any objects they create will be owned by them. In your example this is BJohnson10. This isnt a problem either.
However now you have the situation where some objects are owned by dbo, and some are owned by BJohnson10, so when a developer comes to write some T-SQL, they have to know who owns the object they want to refer to, and explicitly refer to them using the fully qualified name like this
<Owner>.<Object Name> or BJohnson10.Table1
For objects owned by dbo, this is easier as any object reference automatically defaults to dbo as the owner, so can be referenced just as <Object Name> or Table2. Although the fully qualified name is dbo.Table2, the system manages the dbo part by default.
Another dimension to this whole question is that of security. For more information on creating secure databases solutions, take a look at the latest materials on this at
http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnnetsec/html/threatcounter.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/secnetlpMSDN.asp?frame=true
Regards
Steve
No comments:
Post a Comment