Newbie Questions On Schemas, Roles, Users & Logins

Apr 5, 2008

Sql 2005
I want to grate execute permissions on my stored procedures to a role. While creating the role, it asks for "schemas owned by this role".
To me, the schema is merely a namespace that allows you to group objects, but arent schemas such as db_datawriter roles that are central to the db and only admin type users should have ownership of these, correct ?

In a nutshell, I want to:
create a new role and assign a user to that role
with a stored procedure, grant execute permissions to this role

I was confused by the sql 2005 dialog that asks me to take ownership of roles such as db_datawriter, db_datareader etc, wouldnt that mess up other things with the database ?

help ...

I think its time I review all of the above items
role
user
login
schema

View 4 Replies


ADVERTISEMENT

Schemas, Users, Logins, Database Roles, Application Roles

Mar 5, 2006

Hello,

I am new user of SQL Server. I have some problems with these words. I want to make my database works in my specified permissions. I will specify permissions with schemas and these schema wants an owner. I want this owner should be my user. When creating a user it needs a valid login. I am selecting my login and it occurs and error says this login has an different user. I am specifying permissions with roles. But i can't make association all of them. I hope i told my problem to you as well. If you explain these words to me and tell me how can i do my database's works with my own schemas, users and roles i'll be grateful. Thanks for advices.

Happy coding...

View 4 Replies View Related

Users/Roles/Schemas

Nov 27, 2006

I'm trying to find some documentation or procedures that will allow me to xfer existing users' roles, etc from sql2000 to sql2005.
When our sql 2005 database was restored on a new server (from sql2000), all of the database users were orphaned. I need to create identical server logins and then make the logins database users. It is also important to understand the significance of the new schema concept. The Microsoft SQL2005UpgradeTechRef.doc white paper does not explain any of this.
Ultimately, I would like to create a script for the above scenario once a sql2005 db is restored from a sql2000 db.
Could someone please help me out on this?

View 1 Replies View Related

Users/Roles/Schemas

Nov 27, 2006

I'm trying to find some documentation or procedures that will allow me to xfer existing users' roles, etc from sql2000 to sql2005.

When our sql 2005 database was restored on a new server (from sql2000), all of the database users were orphaned. I need to create identical server logins and then make the logins database users. It is also important to understand the significance of the new schema concept. The Microsoft SQL2005UpgradeTechRef.doc white paper does not explain any of this.

Ultimately, I would like to create a script for the above scenario once a sql2005 db is restored from a sql2000 db.

Could someone please help me out on this?

View 1 Replies View Related

Questions On Users/Schemas

Oct 24, 2007

Hi,

I am looking for some advice on securing a sql 2005 database.

I have a database to which I want to grant 3 different users access.

The first users, who we will call 'public' should have access to a set of stored procedures, and no access to tables without using the stored procedures they have access to.

The second users have again got access to a certain set of stored procedures, along with the stored procedures for 'public'. These should be called 'moderator'.

Finally the third set of users 'admin' should have access to all stored procedures, but again no access to the database unless its through a stored procedure.

Questions :

Using SQL 2005, how do I assign access to particular stored procedures to a user?

How do I ensure that a 'user' cannot access stored procedures I don't want them to access?

Some of the stored procedure use dynamic sql within them, will this affect my setup. If I deny direct access to the tables to all three users, but allow them access the stored procedures, can the stored procedures access the tables?

If schemas are the answer, how on earth do I set them up, Ive never seen something so badly documented online in my experience! In my development environment im using sql express, so will probably working through the query analyzer.

Thanks in advance.

Conor

View 2 Replies View Related

I Cannot Get The SQL Server 2005 Roles, Schemas, Users Correctly Setup For Proper Access

May 16, 2008

I have been struggling with this for a while and cannot get it right. I have read countless articles on the internet as well as MSDN documentation about SQL Server 2005 and no success so far.

What I want is a database with multiple SCHEMAS, DATABASE ROLES and USERS in order to have a finer grade of security to access the various objects.

My schemas are (in order to simplify the situation and provide an example of the setup):

- [dbo] the standard DBO schema which is always default. Contains public objects.
- [com] a special module integrated into the system
- [ofc] contains objects used by back-office only
- [aud] contains objects used for auditing, etc.

Each of these schemas has their fair share of tables, views, functions and stored procedures which have been created appropriately (i.e. CREATE TABLE [ofc].[Addresses]), in other words prefixed by the name of the schema to which they belong.

Then I have created various database roles (don't confuse them with SQL2005 application roles) as follows:

- PublicRole mostly used for viewing, no data alterations
- WorkerRole used by front end processes that need write access to data in [dbo] and [aud]
- OfficeRole used by back-office for dealing with backoffice data (basically [ofc], [aud] stuff)
- AdminRole used by application administrator

Each of these database roles has been defined with owner 'dbo', none of them own any schemas. And last but not least to each of these roles I have selected the above named schemas (dbo, ofc, aud) as securables and for each of those securables schemas I have then given the correct set of GRANT/DENY on the Alter, Control, Delete, Execute, Insert, References, Select, Update, Take ownership and View definition.

As an example, the PublicRole role has been given the following permissions (Y=GRANT, N=DENY):

Table #1 of Application Permissions [dbo] [com] [ofc] [aud]Alter N N N N
Control N N N N Delete N N N N Execute Y Y N Y Insert N N N Y References Y Y N Y Select Y Y N Y Update N N N Y Take ownership N N N N View definition N N N N

And I have the following minimum set of database users defined (the server login has the same name):

- upublic, assigned to PublicRole
- uworker, assigned to WorkerRole
- uoffice, assigned to OfficeRole
- uadmin, assigned to AdminRole

As I understand when I assign these users to a particular custom Database Role, the users inherit the permissions granted to THAT role thus liberating me from having to assign the permissions to each and every user account on the same role.

What I expected was that when I logged in to the database with the upublic user account I would at least be able to view (SELECT at least) ALL the objects with the exception of those in th e[ofc] schema. Unfortunately the account is not able to access ANYTHING at all, I get an error like

"The SELECT permission has been denied on object XYZ, database DB, schema 'dbo'"

So, when I use Management Studio to look at the properties I selected the PublicRole and it showed the upublic user as a member of the role (Members of this role). So far so good.

Then when I switch to the Securables page for this role it shows all the schemas I defined and for each of them the same list shown in Table #1 except it has two lines for each permission, the first for Grantor dbo and the second for Grantor upublic. The first has the same permissions I assigned to the role (as shown on Table #1) but the 2nd does not show a checkmark on either GRANT or DENY!!! For example ([x] = checked, [ ] unchecked):

Table #2 Explicit permissions for Securable
Permission Grantor Grant Grant-with Deny
Select dbo [x] [ ] [ ] Select upublic [ ] [ ] [ ]

What am I doing wrong here? Apparently I then have to repeat the whole grant/deny for EACH and EVERY USER I define when the idea was that I would grant/deny on the database role and every member of that role would inherit those permissions automatically.

View 3 Replies View Related

Permissions Hierarchy - GRANT On Logins/users/roles

Jun 20, 2005

A question on the permissions hierarchy:
Since logins, database users, and database roles are both principals and securables - what does it mean to GRANT permission on a login/user/role to another principal? Does it mean that for a login - you can GRANT permission to EXECUTE AS that login or modify it, for example?

View 3 Replies View Related

Some Questions About Namespaces And Schemas

Jun 20, 2007

Hi eveyone, I'm reading about namespaces and schemas in MS SQL 2005, and that's exactly what I was looking for for the structure of my database.

I've a database and 4 different applications that will use it, and every application will create a new database every year, for example, i'd like to use the following schema:

MainDatabase.MyApplication.MyYear.MyTable

In MS SQL i've created my main schema using:

USE Mydatabase;
CREATE SCHEMA MyApplication
GO

Now I want to add sub-groups (in this example, I need to create Year2006, Year2007, and so on).

Even If i create those schemas, how can I "add" them inside the Salary main schema?
I've tryed with
ALTER SCHEMA MyApplication TRANSFER Year2006

but it doesn't work since Year2006 is not an object.

Thank you!

View 6 Replies View Related

How Can I Use Default Schemas Of Users In A Function ?

Aug 2, 2007

Hi,

I've a Problem with a Function called by different users.
I want the different callers to query a table in their own default Schema.

So if i refence the full Path [Schema].[Tablename] it works Properly.
If i just Use the [Tablename] for reference it fails.

The function was created with EXECUTE AS CALLER option ;

if I call it with dynamic SQL i retreive the error-message

"Only functions and extended stored procedures can be executed from within a function."

does anybody know a solution for this problem?

thanks in advance
Raimund

View 2 Replies View Related

MSSQL 2005 Schemas Vs SQL 2000 Users

Aug 20, 2007

Hello,
I think now MS SQL 2005 support packaging database object into schemas which may be granted access by any of the db users, while SQL 2000 only we could use the database creator user instead of schema. my case is i am working in a system with more than one module, e.g. HR + TaskManagemt.
Both HR and TaskManagement objects are in the same database, and there are some common objects.
I want to isolate the HR objects from the TaskManagemt objects, so i can package any module separated from the other, suppose i want to buy only the HR module, so that i want only to exctract the HR Object + the common objects but not the TaskManagement objects.
So how can i accomplish such operations using SQL 2005 schemas AND using SQL 2000 users.
P.S. i have two servers one with 2000 and the other with 2005, so i want to find solutions for both 2000 and 2005
 Thanks in advance

View 3 Replies View Related

Roles/users

Oct 4, 2004

Is there a script or can I make a script to find out what roles and what users are assigned to the roles are?

View 4 Replies View Related

Users And His Roles

Sep 16, 2006

How to generate script which can move users with his roles from one DB to another (SQL 2005) ?

View 1 Replies View Related

Detach/attach Move Fails To Bring Over Roles & Logins Correctly

May 23, 2001

A database move was accomplished by detaching the database from the legacy server and attaching it to the new server. The servers ran NT 4, SP6a, SQL 7 SP2. The new server had the same name and IP as the old server.

However that process (detach attach) does not bring over the users (who had access to the database on the legacy systems) correctly.

Under databases, roles the users existed. Under security, logins they did not.

We were obliged to drop the roles and recreate the logins and assign new roles. In the case of an NT user group we were unable to drop it. We had to create a new one and add the users to that group under User Manager.


So far I have not found anything that deals with the user account/role problem.

We have to move a similar database tonight. Do any of you know of an alternative "move" that brings the user roles/logins across correctly?

Thanks in advance.

View 4 Replies View Related

Changing From Users To Roles

Apr 2, 2008

Guys,

I have 2 users emp_rw (read write) and emp_ro in the database through which application accesses the database.

Now I would like to replace this users with roles and assign emp_rw, emp_ro to roles. Which roles should be created -
database roles or application roles what is the difference between application and database roles.

currently I execute the below statement to grant rights on database objects to emp and emp_ro users, can this be changed
to grant rights to role instead of user.

grant execute on <function name, procedure name> to emp_ro

Any suggestions and inputs would help.

Thanks

View 1 Replies View Related

What's The Difference Between Roles And Users?

Oct 12, 2005

Hi, all. I've got a question that's truly newbie. I've added logins to the "users" of a database, but I've never used the "roles" area. What's the difference? Is a role like a group account with some preset permissions?

View 3 Replies View Related

Newbie To Remote SQL 2005 Express - Need Roles/security Advice

Aug 30, 2006

Hi,I'm
building an asp.net website using web developer express and I have a
SQL 2005 express install on the same machine.  Using windows security,
everything works fine for development.Now I need to get it working at the client site, where the web server and SQL 2005 Express are on different machines.I'd
tried using windows authentication but that didn't work, probably
wasn't doing it correctly.  I'd like to try SQL Authentication, at least temporarily, since I
can replicate that on my laptop at home easily I think.I created a new SQL login but was really baffled by the screens showing roles and schemas, etc.   There's so many roles to choose from and wasn't sure if this new login needed to own any schemas. I
did turn on remote connections and mixed-mode authentication, the
probably now is my asp.net membership provider login page isn't
authenticating correctly, maybe my permissions are wrong on the
aspnet_.....  tables for users, roles, profiles, etc. Any advice?thanks,Bruce

View 3 Replies View Related

Adding Roles/Users Using SQL Procedures...

Dec 3, 2003

Hi everyone out there in ASP.NET land.

Have a quick question...

How do I add a role and/or a user through code (Specifically SQL Statements). If not through SQL, then maybe VB.NET?

Thanks ahead of time,
Denvas

View 2 Replies View Related

Users Not Listed While Adding To Roles

Mar 5, 2000

Hi there NT Server,sqlserver 7.0, Integrated Security. I used "sp_attach_db" to attach a database to the sql server. The database has 3 standard roles with members in each of those roles. But i am not able to add a user to any of the roles through Enterprise Manager(No users are listed, except the other 2 roles). Also when i click "users" under the Database in EM, no users are listed except "dbo" with sa login. Luckily since some members are there in the roles, they are able to connect to the database. Also i am not able to add the user bcos the user exists in the public role and i get an error message "user already exists in DB". The user has logged into the NT and everything is fine. I copied the .mdf and .ldf files from a "Standard Security" Server.

View 1 Replies View Related

Simple Question: Users && Roles

Jul 23, 2004

SHORT VERSION
i am setting up roles, do i also have to set up role-people as users?

LONG VERSION
my db has two owners. both of us run the Access front end happily - everything works perfectly.

now i'm trying to add non-owner users.
i have set up ten people as datareader/datawriter (primitive, but will refine this later).
these people are not able to get into the db.
at the registering DSN stage they can't see the server in the list of servers and if they manually type \myserver they can't connect (doesn't exist or access denied).

in Enterprise Manager,
Users: shows only the two owners
Roles:datareader shows the ten non-owners (ditto datawriter)

am i supposed to setup my datareader/writers as users as well?
should i see them in the Users: list?

thanks for your time.

izy

View 2 Replies View Related

List Of Users + Roles + Rights

Feb 27, 2004

How can I generate a list/view of all users/groups with appropriate roles and rigths?

View 3 Replies View Related

ASPNETDB Deploy With Users/Roles Security

Apr 10, 2007

I have developed a site on my local machine utilizing the built-in security/roles provides by ASP.NET 2.0.  I am trying to publish the web application to a production server.  It will publish correctly, however the ASPNETDB is not recognized.  The folder app_data is created with the proper database files.  My question is how do I set this up to use the data I have created in this database?  I've searched on how to accomplish this but haven't found any definitive answers.  I have found ScottGu's blog to be useful, but I was wondering if there is a different way.
1 - Do I push the data to a SQL Server install via SQL scripts?
2 - Can I link to the ASPNETDB that is created locally on my machine?
3 - If I make changes to the application and re-publish, is there a way to keep from overwriting the ASPNETDB on the server?
I am a unsure of how the built-in roles/security works when you are ready to push something to production.  If someone wouldn't mind pointing me in the right direction, it would greatly be appreciated.  Any literature, advice, links, etc.. would be great.
 
- Thanks
Andrew 

View 4 Replies View Related

SQL 2000: Users, Roles, Permissions Management

Jul 20, 2005

I am in need of a utility (stored procedure, third party app, etc)that will help streamline the process of managing and auditing objectpermissions, users and roles on multiple sql server 2000 instanceswith multiple databases on each instance. That's a quick overview ofwhat I need, do I need to be more specific?Thanks.

View 2 Replies View Related

Logins And Users

Sep 4, 2006

I wanted to create two users in SQL Server to be used by my application. The first would have read only access to all the tables in the database, the second would have read and write access.
I tried to use one login for both but when I tried to create the second user in my database I encountered the following error :

Error 15063 : The login already has an account under a different user name.

Do I need to create two separate logins in SQL Server to achieve this? If so, what if I want various users all with different access rights to different tables. Do I need a new login and a new user for each.

View 1 Replies View Related

Users And Logins

Jan 14, 2007

hi all ,
any decribtion about users and logins and differncs between them ??
and any example for real use in real life ??
i use logins user name and passwords in the connection string from c# but how users can make difference with that ??

thnks so much for your help

View 4 Replies View Related

Logins And Users

Sep 29, 2006

Hello,

How can I login in one databse from Sql Management Studio? Do I need one login for each user?

How does it work?



thanks,

View 4 Replies View Related

Newbie's Help 2 Questions

Sep 8, 2004

There is 1 error when i tried to install msde into my window 2003 server web edition.
1. I use command prompt to enter c:\sql2ksp3>setup SAPWD=aA1234567
the errors is "go to the control panel to install and configure system components"
How do i install ?

Sql client for 2003 server web edition
2. i tried to install sql client in window 2003 web edition but the msdn cd could not start after i double click on the setupsql.exe. I thought the sql client can be install but not the server on web edition ?

View 2 Replies View Related

Newbie Questions

Jan 29, 2006

I am a Sys Admin and I am studying SQL to obtain a dba. I am currently running through the 70-228 book and I have a couple questions maybe someone can set me straight.

For SQL Server backups we use Tivoli Storage Manager.

I am currently reading up on DTS, I have used DTS to move databases before. It is pretty straightforward. My question after reading about the usefullness of DTS packages is what are they used for commonly by DBA's? Are they used for backups or are they for pushing transformed data to secondary applications/db's. I see how it works but I want to connect the dots with real world uses.

Another question is about how much you tweak a SQL 2000 db. I have been told by people smarter than me, that very little is done to the DB's after they are created because SQL does a excellent job of optimizing itself. If I have a DB server that is suffering from a lot of I/O overhead what is a way that I can diagnose what is causing the issue. How could I tell if it was hardware growing pains or poor design?

View 1 Replies View Related

Newbie Questions

Feb 25, 2004

I am pretty new to databases and was wondering whether you guys can help me out or point me in some sort of direction. I am working on my senior design project for college and my group decided to use SQL Server for our databasing needs. So far we installed SQL Server and created out database with permissions and all that stuff. So here is my question:

As of right now we are talking with a company (sniffer software) to get access to some of there code. This program provides information such as host ip and mac address, destination ip and mac address, protocol, port number, bits in, bits out, etc. What we wanted to do was get access to where this information is stored in there program and then push it to our database so we can do analysis on the data. But aside from getting access to this information in the program (we looked into writing an application that does all this ourselves but we are on a time limit) I am confused how to set the database up so that we can have automatic updates to the database using the information we pull from the program. I did a search here and did not find anything and i have been looking on google and the such and haven't had any luck finding anything that will point me in the right direction. If any of you guys can help us out with information it would be greatly appreciated

thanks
Evan

View 14 Replies View Related

Newbie Questions

May 8, 2007

Hi all, ive just started on SQL server 2005 and Visual website developer. I have managed to start up a database and display it on the server.

But for my website, i need place 6-8 links to a catagory,and then to a sub-catagories. Im not sure on how to start such a thing and how to place links really - any chance of possible tutorial on the net? Thank you.

View 1 Replies View Related

Newbie Questions

Jun 13, 2007

I have a fair bit of experience in designing database apps using VBA with MS Access for use on a single PC or for multiple users on an office LAN. I also have some limited web design skills using FrontPage 2000 and Adobe GoLive. However, I am now trying to find the best way (for me) to create a website with an associated online database - something I have never done before. Ideally, I want cheap or free software. I would also prefer visual design tools, like the Access interface.



I have some newbie questions:

SQL Server Express looks like it might be part of a solution. However, I would appreciate some guidance on the limitations of using this free software. What are the situations that would create a need for upgrading to one of the paid for versions of SQL Server?

Would the free webspace facilities provided via many ISP broadband services be suitable for hosting an SQL Server Express database or does this normally only come at extra cost?

What web design tools enable visual design of a website using SQL Server Express?

I have no experience of either SQL Server Express or MySQL, but are there any good reasons why one might choose one over the other?

Any guidance would be much appreciated. I realise I have much to learn!



David

View 13 Replies View Related

Questions From Newbie

Jun 2, 2006

just finished installing SQL Express, and now, dont know what to do next :)
- I have installed FULL. Does it have any GUI tool for me to create a database?
- how can I login into system?
- how can I restore a backup file? I have a backup file from SQL 2005 standard
- how can I create backup for databases?

thanks

View 8 Replies View Related

Questions From A Newbie

Nov 20, 2006

Just starting out with datamining and all the endless posibilities with it. One of my first questions are is it possible to datamine n-series data.

For example:

Serie 1: 10, 12, 14, 16, 12, 10
Serie 2: 2, 3, 4, 6, 3, 2
Serie 3: 30, 24, 20, 10, 24, 30 (a sort of an inverted pattern)

Lets then say somebody add another datapoint in Serie 1, so...

Serie 1: 10, 12, 14, 16, 12, 10, 12
Serie 2: 2, 3, 4, 6, 3, 2, ?
Serie 3: 30, 24, 20, 10, 24, 30, ?

Can datamining tell me Serie 2 and Serie 3 missing datapoint based upon Serie 1's new number?

This is indeed very simplified data, but I hope the it's possible to see the logic in my question

View 1 Replies View Related

Logins And Users Question

Sep 13, 2007

Ok, let me preface my question with a little info about the application I am working on. I am in the middle of creating a project in VB.Net for my company. We have a data management system for handling sampling data. Now the database design is like so. The application is able to handle multiple "Sites". We create a new database for each site that is create dint eh application. These databases are identical in structure but the data is obviously different.

Now we don't actually delete any records in this application rather we mark items as deleted instead. This allows us to easily undo any changes that have been made to the data. When a change or delete are made, we record this change so that reports can be printed to show what changes were made and by who. This is all well and good, but my thoughts are this.

At the moment I am writing lots of VB code to handle adding these records of change and inserting them into the database... What I would like to be able to do is to just create Triggers on the tables to add them. This is something that I know how to do and i feel like it would be the better way to do it except for one thing... here comes the issue...

I have no way of knowing what user is logged in to my application from within the trigger because the application uses a single login for accessing the database. My thoughts are this... Would I be crazy to think that it would be a good idea to create SQL server logins for each user that is created in the application, giving these users access to only the database that they have been created in? This would allow me to determine who was logged in when the change was made and could then implement recording changes through triggers... I am not a very experienced dba programming is more my speciality. I know how to implement this idea, but I am just wondering if this sort of thing is considered bad practice or if it is something I should consider implementing...

Sorry for the novel there and thanks for any help or insight.

Brian

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved