Friday 21 June 2013

Creating a schema in SQL Server



Creating a schema

The following example creates schema worldtour owned by reffri that contains table places. The statement grants SELECT to Tom and denies SELECT to Anke.
Note that worldtour and places are created in a single statement.

Create database worldtrip;

Once created then

USE worldtrip;
GO
CREATE SCHEMA worldtour AUTHORIZATION reffri
    CREATE TABLE places (Countrycode int, costperhead int, age int,address varchar(40))
   
          GRANT SELECT TO tom;
          DENY SELECT TO anke;


No comments:

Post a Comment

Popular Posts