Skip to main content

Creating INDEX in VIEWS

Creating view with SCHEMABINDING

  1. Ensure the view is created with the SCHEMABINDING option.

Important Considerations:

  1. SCHEMABINDING: The view must be created with the SCHEMABINDING option, which means you cannot alter the underlying tables without first dropping the view.
  2. Unique Clustered Index: You must create a unique clustered index on the view before creating any non-clustered indexes.
  3. Indexed View Limitations: There are certain limitations and restrictions on what can be included in an indexed view. For example, you cannot use OUTER JOIN(LEFT or RIGHT JOIN)UNIONTOPDISTINCTSUMAVGMAXMINCOUNTSUBQUERIES, etc.

Creating Index

  •  in SQL Server, you cannot create a non-clustered index on a view without first creating a unique clustered index on that view. This is a requirement for indexed views (materialized views). The unique clustered index is necessary to ensure the view's data is stored in a consistent and efficient manner.

    Steps to Create Indexes on a View

    1. Create the View with SCHEMABINDING: Ensure the view is created with the SCHEMABINDING option.
    2. Create a Unique Clustered Index on the View: This is mandatory before creating any non-clustered indexes.
    3. Create Non-Clustered Indexes: Once the unique clustered index is created, you can create non-clustered indexes on the view.





Comments

Popular posts from this blog

Convex Lens Vs Concave Lens

What is a Lens A lens is a transparent object that transmits light across it, and its working principle depends on the   law of refraction (Snell’s law) . Applications: Concave Lens help with Far-Sight Convex Lens help with Near-Sight

Herbal Plants

Herbal plants to grow in home Different types of keerai ----- http://www.indiandietrecipes.com/2016/03/pictures-of-various-types-of-greens-or.html Pirandai ----good for bone joins---- https://youtu.be/k2DGubyXLAE Valarai Keerai Benifits ----- https://youtu.be/33HIfLJKTqA Sesma seeds ---- https://easyayurveda.com/2011/02/24/sesame-and-sesame-oil-benefits-total-ayurveda-details/

What is Verbal and Non-Verbal communication

TYPES OF COMMUNICATIONS: