Clustered :
1)index creates a physical order of rows
2)There can be only one clustered index on the table.
3)The size of the clustered index is large.
Non-clustered:
1)index is also a binary tree but it doesn't create a physical order of rows. So the leaf nodes of nonclustered index contain PK (if it exists) or row index.
2)There can be multiple non- clustered indexes on the table
3)The size of the non-clustered index is smaller than the clustered index.
Store Procedure vs Function
Store Procedure-:
1)Store Procedure can return zero or n Values
2)store procedure can have Input and output parameter
3)Procedure allows select as as DML Statement[Insert/Update/Delete]
4)procedure handled by try-catch-block
Function-:
1)Function Can return one value which is Mandatory
2)function can have only input parameter
3)function allows only select statement
4)Try-catch-block cannot be used in function
Thank You
ReplyDelete