What is the difference between a schema and a table and a database?

后端 未结 14 1226
一整个雨季
一整个雨季 2020-12-07 07:18

This is probably a n00blike (or worse) question. But I\'ve always viewed a schema as a table definition in a database. This is wrong or not entirely correct. I don\'t rememb

14条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 07:44

    More on schemas:

    In SQL 2005 a schema is a way to group objects. It is a container you can put objects into. People can own this object. You can grant rights on the schema.

    In 2000 a schema was equivalent to a user. Now it has broken free and is quite useful. You could throw all your user procs in a certain schema and your admin procs in another. Grant EXECUTE to the appropriate user/role and you're through with granting EXECUTE on specific procedures. Nice.

    The dot notation would go like this:

    Server.Database.Schema.Object

    or

    myserver01.Adventureworks.Accounting.Beans

提交回复
热议问题