|
SQL Server Home
SQL Server 2000 SQL Server 2008 TutorialAbout SQL ServerSQL Server Editions SQL Server Management Studio Create A Database Create A Table Adding Data SQL Scripts Query Designer SQL Server Views Stored Procedures User Logins Server Roles Database Schemas Linked Servers Integration Services Summary FREE Hosting!With every domain name you register with ZappyHost, you get FREE hosting.$1.99 Domain NamesWith every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99. |
SQL Server - Database SchemasEver since SQL Server 2005 was released, each object in a database has belonged to a database schema. SQL Server 2008 has continued with database schemas, and an explanation follows. What is a Database Schema?A database schema is a way to logically group objects such as tables, views, stored procedures etc. Think of a schema as a container of objects. You can assign a user login permissions to a single schema so that the user can only access the objects they are authorized to access. Schemas can be created and altered in a database, and users can be granted access to a schema. A schema can be owned by any user, and schema ownership is transferable. Creating a Database SchemaTo create a database schema in SQL Server 2008:
Add a Table to the New SchemaNow that we have a new schema, we can add objects such as tables, views, and stored procedures to it. For example, we could transfer the table that we created in the earlier lesson to the new schema. When we created that table (called "Individual"), it was created in the default database schema ("dbo"). We know this because it appears in our object browser as "dbo.Individual". To transfer the "Individual" table to the person "schema":
Your table has now been transferred to the "person" schema. Confirm your ChangeTo confirm the change:
Enjoy this website?
Oh, and thank you for supporting Quackit! |
Need Content for your Website?Get unique, quality digital content for your website. You can even earn money by reselling it!Includes:
|