Help me out Please!!

  • I am new at sql and i had some of the sql queries ,but i dont know which query is the best query

    for my server or the best optimized query. Can anyone help how to know the best optimized query??

  • If you have multiple queries and you want to see which is best, run them and time them, it's that simple. Use STATISTICS TIME.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Also use STATISTICS IO and compare the number of reads and writes. Do that in addition to measuring time. Both are applicable.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply