views:

27

answers:

3

Just wondered if there was a secret to do something like Database.Security.Users like AdventureWorks DB is setup. Seems no matter what I do to try to setup "Security.Users", I always get the dbo in front of it and have a hell of a time in C# accessing the info. Am I doing something wrong?

+1  A: 

If you are using the Wizard to create this, you will always get it. Write the SQL statements and you should be fine.

Ardman
I figured SQL statements would save the day...however, I am attempting to design an app with the Visual Studio 2010 work flow just for the fun of it...so far, no fun :(
ThaKidd
+2  A: 

you first need to create a schema and make that schema the default schema for that user. Examples and more info can be found here: http://msdn.microsoft.com/en-us/library/ms190387.aspx

SQLMenace
I will check this out...danke
ThaKidd
+2  A: 

Are you trying to create an object called Security.Users with a dot? (as opposed to Users in the Security schema?) That's probably best avoided as you're seeing, but if you are then the best way to quote the name is probably in square brackets, i.e. [Security.Users].

dbo is the default database schema name. Unless you've configured a different default schema for your users etc. you can usually just ignore it, although it's still needed if you're referencing another database by name.

Rup
Namespace, or Schema...I am confused now. Do you mean that using Security.Users in C#/whatever might cause issues?
ThaKidd
I think I meant schema not namespace, although a 'schema' in SQL Server acts like a namespace. Edited. Reading your question again I think you do mean a schema called Security so I'd go with SQLMenace's answer.
Rup