Apr 11, 2013

Select Sql Query Performance Optimization:

4/11/2013 03:34:00 AM





The Query Performance to execute different ways but display cost value same. The Common table expression to use a Row number to execute the query sharing the cost value.

CTE Using Row index:

;WITH LegoDet AS
(
    SELECT  Legoid,
    ROW_NUMBER() OVER (ORDER BY Legoid) AS "Row Number"
    FROM Lego
)
SELECT * FROM LegoDet where legoid=5984





CTE Using without Row index:

;WITH ProductsCTE  AS
( SELECT *
  FROM lego
  WHERE legoid=5984
)
SELECT * FROM ProductsCTE


Select Query:

select * from lego where legoid=5984



Store procedure :

 exec  Pro_Lego


 


Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

Recent Posts
Popular Articles

 

© 2013 MUNISH ORACLE DBA& .Net Developer. All rights resevered. Designed by Templateism

Back To Top