Re: default schema (SQL Server 2005)
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Thu, 16 Aug 2007 16:07:31 -0400
dnl,
So the answer to your first question was "sqladmin" will always be "dbo" in
a database.
The answer to your second question comes in two parts.
1 - General users should NEVER be sysadmins.
2 - Grant them specific rights either as their personal login or by granting
rights to a Windows Group in which they are a member. (I prefer assigning
rights to Windows groups over individual logins.)
E.g.
1. MikeR needs rights to MyDatabase.
2. MikeR is a member of the Windows group Domain\MyDatabaseUsers
3. Add Domain\MyDatabaseUsers as a login on your SQL Server.
4. In MyDatabase create a security role named GeneralUsers
5. Add Domain\MyDatabaseUsers as a user of MyDatabase and a member of
GeneralUsers.
6. All objects in the database that GeneralUsers should need need to have
rights granted to that role.
a. GRANT SELECT ON ViewA TO GeneralUsers, etc.
b. GRANT EXECUTE ON UpdateSomethingProc TO GeneralUsers, etc.
In the future, when MikeR moves on, simple remove him from the Windows
group. When LisaK takes his place, add her to the Windows group. And so on
and so on. Here is a whitepaper on SQL Server 2005 Security Best Practices.
http://download.microsoft.com/download/8/5/e/85eea4fa-b3bb-4426-97d0-7f7151b2011c/SQL2005SecBestPract.doc#_Toc160646532
RLF
<dnlgauthier@xxxxxxxxxxx> wrote in message
news:1187292090.432045.126570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 16, 1:26 pm, "Russell Fields" <russellfie...@xxxxxxxxxx> wrote:
A sysadmin works within databases in the dbo context, so it will use the
dbo
schema (which has always been the default schema for sysadmins, except
that
is was called 'owner' in SQL ).
So, I don't think you have an option on this.
RLF<dnlgauth...@xxxxxxxxxxx> wrote in message
news:1187272016.929096.136070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Is there anyway to change the default schema for a user who is a
member of "sysadmin". It appears that Microsoft has made the default
schema for this role "dbo" and our application has been writtem not to
include owner/schema name.- Hide quoted text -
- Show quoted text -
I agree with the statement that a sysadmin works with in teh database
as "dbo" context, so how can I provide user access via an application
using Windows authenticate and make it so that he/she is a user not a
member of sysadmin? I hope this is not confuising ?
.
- References:
- default schema (SQL Server 2005)
- From: dnlgauthier
- Re: default schema (SQL Server 2005)
- From: Russell Fields
- Re: default schema (SQL Server 2005)
- From: dnlgauthier
- default schema (SQL Server 2005)
- Prev by Date: Re: default schema (SQL Server 2005)
- Next by Date: Re: Changing Query behavior based on local vs. remote context?
- Previous by thread: Re: default schema (SQL Server 2005)
- Next by thread: Re: default schema (SQL Server 2005)
- Index(es):
Relevant Pages
|
|