default schema for user

when a user creates an obejct, it creates it in a schema of the user's name.
LVL 5
25112Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

25112Author Commented:

for example
DECLA\DevGroup is the Windows Group that has access to a server/db.

when users within this group create an objects.. it creates with
DECLA\DevGroup schema.. how can we try to give them the dbo schema instead of the above when creating?
0
25112Author Commented:
When forced to take the dbo, it complains

The specified schema name "dbo" either does not exist or you do not have permission to use it.

0
dave4dlCommented:
you can alter a user to have a different default schema with something like the code below
ALTER USER [DECLA\DevGroup] WITH DEFAULT_SCHEMA=[some_new_schema]

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

25112Author Commented:
OK.. but i get the error

Msg 15259, Level 16, State 2, Line 2
The DEFAULT_SCHEMA clause cannot be used with a Windows group or with principals mapped to certificates or asymmetric keys.

-------------------------
even if it's not default, how can i give permissions so  that they can create with dbo schema?
0
25112Author Commented:
should I do the below? but we want them to have only
create proc and create function privilege.. no to any tables on dbo..
use [SATSA]
GO
GRANT ALTER ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT CONTROL ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT DELETE ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT EXECUTE ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT INSERT ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT REFERENCES ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT SELECT ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT TAKE OWNERSHIP ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT UPDATE ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO
use [SATSA]
GO
GRANT VIEW DEFINITION ON SCHEMA::[dbo] TO [DECLA\DevGroup]
GO

Open in new window

0
25112Author Commented:

wish this was a valid syntax.. then that is exactly what i would have needed...
GRANT CREATE PROCEDURE ON SCHEMA ::dbo TO [DECLA\DevGroup]
GRANT CREATE FUNCTION ON SCHEMA ::dbo TO [DECLA\DevGroup]
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.