Forum Replies Created

Viewing 15 posts - 16 through 30 (of 219 total)

  • RE: question on indexes

    Please post the DDL and PLAN of the query. Does your query have sarg for some of these columns and joins on other columns or maybe sarg on almost all...

  • RE: Is INTERSECTS the best method to accomplish this?

    --see the results yourself..Intersect will perform better then other two and if proper indexes will be there the diff will be huge.

    Intersect perform badly in Dwain's test because he has...

  • RE: Is INTERSECTS the best method to accomplish this?

    Do not use the method posted by me.That was wrong..Below one is correct..

    Try all 3 methods for your query and see which one is the best.If there is clustred index...

  • RE: Is INTERSECTS the best method to accomplish this?

    You have to change that query..I just used a table a.Change it as per your requirement... like a will be your table name,id will be ordno and cd will be...

  • RE: Is INTERSECTS the best method to accomplish this?

    Gullimeel (7/9/2012)

    --------------------------------------------------------------------------------

    Try something like this.

    --change the id with ordno and cd with product code

    select * from

    (

    select id,

    max(case when cd = 'A' then 1 else 0 end) +

    max(case when...

  • RE: Is INTERSECTS the best method to accomplish this?

    Try something like this.

    select count(ordno) from

    (

    select OrdNo,

    sum(distinct(case when ItemNo = 'A' then 1 when ItemNo = 'B' then 2 when ItemNo = 'C' then 4 end)) as status

    from OrdLine

    where...

  • RE: SQL Query Tuning help

    Post the plan of your query and ddl for tables.People might be able to help u on getting your query optimized..

  • RE: Multiple Recursive References inside CTE

    rCTE is a kind of loop.If this loop works with set of data and very few loops(recursion) results are good.but if it does row by row it wont be so...

  • RE: Multiple Recursive References inside CTE

    Try below..Modify it as per your need.

    ;WITH Abstraction(pYear, pMonth, pValue, jan,feb,mar,april,may,june,july,aug,sep,oct,nov,decb) AS

    (

    SELECT 1999

    ,12

    ,cast (0 as float)

    ,cast (0 as float)

    ,cast (null as float)

    ,cast (null as float)

    ,cast (null as float)

    ,cast (null as...

  • RE: Index Fragmentation - Scans/Seeks

    If I find that my Index does have a Low Average Page Density,

    Can I avoid this by using a Higher Fill Factor when/if I rebuild?

    Are you using fillfactor for your...

  • RE: SQL Query Tuning help

    You have view in the query so it is not possible to create the indexed view.Also, indexes views are dynamic and are refreshed automatically.But it has many more restriction.

    For more...

  • RE: Index Fragmentation - Scans/Seeks

    Personally, i think people consider just the avg fragmentation counter to decide whether to rebuild the indexes or not.I think using this counter alone is a bad idea.It mainly impcats...

  • RE: Stairway to SQL Server Indexes: Step 13, Insert Update Delete

    There is a DML trigger defined on the table.

    Can you please let me know if this in actually cause delete/insert for updarte? I couldnt see this behaviour.

  • RE: Identifying Joined Fields in a Query

    Only way to do it is manually.Unless these tables are from same linked server and have some relationship.Even then you might have to check it manually because sometimes joins...

  • RE: Store Procedure Optimization

    For perforamnce issue you need to give the showplan,ddl and others details.Please see in my signature how to post the perf issue.

Viewing 15 posts - 16 through 30 (of 219 total)