Skip to main content

Posts

Showing posts with the label Create non clustered index sql server

What is a trigger in SQL Server? Why use triggers?

What is a trigger in SQL?  Why use triggers? A trigger is a special kind of operations that execute automatically when an event occurs in the database (tables and views) when you trying to INSERT , UPDATE OR DELETE operations in the tables and views. All the triggers are directly attached with the tables and views. Each of the tables has their own trigger. Noted Points :- 1.       We can’t create triggers against the system tables and views. 2.       The AFTER triggers can’t be defined on the views. 3.       You try to avoid using nested triggers. 4.       You try to avoid using recursive triggers. What types of trigger in SQL Server ? There are two types of Triggers available in the SQL that is DML Triggers : - i) After Trigger      ii) Instead of Trigger DDL Triggers There are three query actions that are used in S...

What is Nonclustered Index? How to create Nonclustered Index?

What is Nonclustered Index? Non-Clustered Index, 1.       Non-clustered indexes  can be used more than one time per table. 2.       Non-clustered indexes store logical structure but clustered indexes store in physical order. 3.       Faster for insert and update operations than a clustered index. 4.       Improve the performance when select data with index fields. 5.       Non-clustered indexes are stored separately. 6.       We can add only 249 non-clustered indexes for a table. 7.       Non-clustered indexes made on the any key but clustered indexes only on primary keys. How to create Nonclustered Index? -- CREATE NONCLUSTERED INDEX CREATE NONCLUSTERED INDEX Indexname_Employee ON Employee (     [EmpName] ASC --OR DESC,     [EmpDepartment] ...