SQL SERVER Reading notes: (i)

Source: Internet
Author: User

Recently read the "SQL SERVER 2008 Complete Manual", see the ebook has not been the habit of taking notes, so many things learned and forget, basically equal to not learn.

Familiar and already mastered knowledge points are no longer recorded, here only to record the more uncommon knowledge points in learning:

Database Engine:

Stores and processes relationships, and is responsible for the storage, processing, and security management of the data. Analysis Services:

Identity property:

With identity, you can set a column to an identity column, which increases the number of rows in the table.

The identity must specify two values: a seed value and an increment value. Identity (seed, increment)

eg. CREATE TABLE Test (ID nchar (0,1) PRIMARY KEY not NULL)

Default property:

Fields that are not valued are automatically used with default modifiers. e.g. CREATE TABLE test (ID nchar (TEN) not NULL default "not Attend")

Use rules: Create rules:

Binds a rule to a data table column or to a user-defined data type after the rule is created. When you create a rule, you must satisfy the rule if you insert or update data to the column or data type of the binding rule.

Create Rule Rule_name

As

Condition_expression

E.g:create rule compare as @value > 0

Binding rules:

Use stored procedure sp_bindrule.

Sp_bindrule rule_name, Object column name

e.g:

Use Test EXEC

Sp_bindrule ' compare ', ' test.column '

Unbind:

Unbind using stored procedure Sp_unbindrule

e.g:

Use Test

EXEC sp_unbindrule ' compare ', ' test.column '

To view the rules:

You can use sp_help stored procedures to view rules.

Use Test

EXEC sp_help Compare

View the definition of a rule use Test EXEC sp_helptext Date

To delete a rule:

Drop Rule RuleName

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.