1 / 7

Good Afternoon

Good Afternoon. RULES. Rule is an object, when bound to a column, specifies the acceptable values that can be inserted into that column. Syntax: create rule < r ulename > as <condition> Ex: create rule r1 as @r<=10 To bind a rule to a column.

sondra
Download Presentation

Good Afternoon

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Good Afternoon

  2. RULES Rule is an object, when bound to a column, specifies the acceptable values that can be inserted into that column. Syntax: create rule <rulename> as <condition> Ex: create rule r1 as @r<=10 To bind a rule to a column. Syntax: sp_bindrule <rulename>, <tbname.colname> Ex: sp_bindrule ‘r1’,student.roll

  3. UNBIND RULE We can remove a rule from an existing column. Syntax: sp_unbindrule <tablename.columnname> Ex: sp_unbindrule ‘student.roll’

  4. View Create a virtual table that represents the data in one or more tables in an alternative way. Synatx: CREATE VIEW <Viewname> AS < Select Statement> Ex: Create view v1 as select roll, name from student where mark>40

  5. Alter View Alter a virtual table that represents the data in one or more tables in an alternative way. Synatx: ALTER VIEW <Viewname> AS < Select Statement> Ex: Alter view v1 as select roll, name from student where mark<=50 and mark>=40

  6. Drop View Removes one or more views from the current database. Syntax: Drop view <view name> Ex: Drop view v1

More Related