Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 New to SQL Server

Author  Topic 

amirssid
Starting Member

4 Posts

Posted - 2010-12-03 : 00:54:56
Hi,

I am new to sql server, thought I have extensive experience (15 years) in all other major RDBMS's (Oracle, MySQL, Informix,...). But now I have to work with SQL server with which I have no experience. I am trying to learn the basics of sql server, I have the following questions:

1> What is the difference between a database user and a database schema? which of these is the owner of a table? I mean, when we refer to a table using it's fully qualified name, is the table name prefixed with the schema name or the name of user who created it?

2> Can a schema contain tables created by different users of the database?

3> When we use grant and revoke (for giving or denying permissions) statements, is the grantee a user or schema? that is, are permissions granted/revoked to/from users or schemas?

Can someone please reply to these questions? I will be highly thankful.

Amir.


AmirSidd

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2010-12-03 : 04:15:48
Have a look at bol - it's all in there.

1. Schema and owner used to be the same thing but they arenow separated. Think of a schema as a container for objects. The owner of the object is independent. A user is a mapping from a login to the database. Access to the server is via a login, access to a database is via a user mapping from that login (it's maintained via a sid - have a look at the system tables). The table is name is prefixed by the schema - fully qualified = server.database.schema.table.

2. Yes

3. grantee is usually a role to which users are added. It depends on the grant statement but table, SP ,view access is usually via roles or users.

Best practise - only give access to stored procedures. Only give access via roles.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -