What is a Schema in SQL Server 2005?

Ask a question
          

Interview questions

What is a Schema in SQL Server 2005?

<<Previous   Next>>

SQL Server DBA - What is a Schema in SQL Server 2005? - Feb 27, 2010 at 22:40 pm by Shuchi Gauri

What is a Schema in SQL Server 2005? Explain how to create a new Schema in a a Database.

A Schema can be used in many ways including: maintain a backup script to allow the user to create all users, groups, logins and permissions, to create/modify development code, to create an environment from it for testing. It acts as the container of all object in the database which can be used to recreate the database along with its objects intact. It is synonymous to a namespace.

Syntax:

CREATE SCHEMA schema_name_clause [ <schema_element> [ ...n ] ]
<schema_name_clause> ::=
schema_name
| AUTHORIZATION owner_name
| schema_name AUTHORIZATION owner_name
}
<schema_element> ::=
{
table_definition | view_definition | grant_statement |
revoke_statement | deny_statement
}

SQL Server DBA - What is a Schema in SQL Server 2005? - March 08, 2008 at 19:10 pm by Rajmeet Ghai

What is a Schema in SQL Server 2005? Explain how to create a new Schema in a a Database. 

A schema is used to create database objects. It can be created using CREATE SCHEMA statement. The objects created can be moved between schemas. Multiple database users can share a single default schema.

CREATE SCHEMA sample;

Table creation

Create table sample.sampleinfo
{
id int primary key,
name varchar(20)
}

<<Previous   Next>>
 



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
 
Home | Login | About us | Sitemap | Contact us