Forum Replies Created

Viewing 15 posts - 946 through 960 (of 1,170 total)

  • RE: Compare data between rows of same table

    I came up to the following, based on your logic

    select t2.mytab2col1,t1.mytab1col1

    from ##Temp2 t2

    join ##Temp1 t1 on

    ((t2.mytab2col2 != t1.mytab1col2) and (t2.mytab2col3 = t1.mytab1col3))

    or ((t2.mytab2col2 = t1.mytab1col2) and (t2.mytab2col3...

    Igor Micev

  • RE: Compare data between rows of same table

    I came up to the following, based on your logic

    select t2.mytab2col1,t1.mytab1col1

    from ##Temp2 t2

    join ##Temp1 t1 on

    ((t2.mytab2col2 != t1.mytab1col2) and (t2.mytab2col3 = t1.mytab1col3))

    or ((t2.mytab2col2 = t1.mytab1col2) and (t2.mytab2col3...

    Igor Micev

  • RE: Compare data between rows of same table

    iam777here4u (4/25/2013)


    That query is having a problem, lets say the records with id value 4 in column mytab1col1 doesn't have any mismatch. The result still displays id 4, which it...

    Igor Micev

  • RE: Compare data between rows of same table

    Maybe you should do a little work around.

    What about this?

    select t1.mytab1col1,t2.mytab1col1

    from ##Temp1 t1 left join ##Temp2 t2 on t1.mytab1col2=t2.mytab1col2

    and t1.mytab1col3=t2.mytab1col3 and t1.mytab1col1 != t2.mytab1col1

    group by t1.mytab1col1,t2.mytab1col1

    order by t1.mytab1col1 asc

    Igor Micev

  • RE: Compare data between rows of same table

    Hi

    Simply use EXCEPT.

    The following

    select col1,col2,...,colN from table1

    EXCEPT

    select col1,col2,...,colN from table2

    will give you the different rows.

    Another option is to use some tool for data/base comparison

    Regards

    IgorMi

    Igor Micev

  • RE: DBCC DBREINDeX

    lianvh 89542 (4/25/2013)


    Good Day.

    I noticed that DBCC dbreindex is still available in 2008R2 . Wehn we run this utility to rebuild PK Custered COnstraints, the Constraints are not droppedd/disbled and...

    Igor Micev

  • RE: Fragmentation

    IgorMi (4/25/2013)


    m.rajesh.uk (4/25/2013)


    Hi all.

    I found there was fragmentation in my server and i rebuild the indexes to remove fragmentation. But even after rebuilding...

    Igor Micev

  • RE: index fragmentation.

    sufiyan.sarguroh (6/8/2012)

    And does the index rebuild/reorg reduce internal frag too ?

    Yes it does.

    Regards

    IgorMi

    Igor Micev

  • RE: Triggers 2

    Nice QotD!

    Thanks

    IgorMi

    Igor Micev

  • RE: Fragmentation

    m.rajesh.uk (4/25/2013)


    Hi all.

    I found there was fragmentation in my server and i rebuild the indexes to remove fragmentation. But even after rebuilding the...

    Igor Micev

  • RE: Index containing Where Clause

    Hi

    Yes, an index can have WHERE clause, starting from sql server 2008 and upper versions (http://technet.microsoft.com/en-us/library/cc280372.aspx).

    Regards

    IgorMi

    Igor Micev

  • RE: FK to IDENTITY

    Hi,

    Nice question! Bravo.

    Thank you

    IgorMi

    Igor Micev

  • RE: Slows system performance

    That was stale statistics resulting in a sub-optimal exec plan (probably estimating one row and getting thousands or millions). Next time just update stats, don't waste time doing a full...

    Igor Micev

  • RE: Slows system performance

    Hi

    From your results it seems you have much schema locks.

    Just had similar scenario yesterday, without locks but with high cpu. Some update scripts were running for 'forever'. We stopped them,...

    Igor Micev

  • RE: No performance gain on queries on different servers with considerable hardware change

    Hi,

    Interesting.

    It may be your log file? Is it on same or different RAID and on what type? It's recommended to be on separate and faster disks.

    It may be your tempdb?...

    Igor Micev

Viewing 15 posts - 946 through 960 (of 1,170 total)