Forum Replies Created

Viewing 15 posts - 48,046 through 48,060 (of 49,552 total)

  • RE: EXISTS does not work with INSERT

    Edit: Cross-post...

    SQL doesn't insert one row at a time. It inserts the entire batch at once The Where clause (with exists) executes before the insert occurs. The operations in the...

    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
  • RE: check my query plz and help me

    Easiest way to do that is with a numbers table. It's a very handly thing for a lot of problems. I'm creating a temp numbers table, but you can create...

    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
  • RE: EXISTS does not work with INSERT

    Your PK is on CustID?

    At the point that the exists runs, the row

    01 Phil_1

    is not in Table1, hence the second row twith aa 01 id si not filtered out.

    The distinct...

    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
  • RE: check query (related to prev post)

    No need to start a new thread for this problem. It will just fragment replies and waste people's time.

    Continue here, please

    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
  • RE: SP execution plan

    As an alternative to the variables, may I suggest creating the proc WITH RECOMPILE so that each execution gets the optimal plan. It will completely eliminate parameter sniffiing.

    With variables, while...

    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
  • RE: UK JOB & US JOB

    Bear in mind that you'll need a work permit to work in either country.

    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
  • RE: SP execution plan

    In theory, and providing there are no temp tables involved, yes.

    I know 2005 when you do an estimated plan, fetched the plan from the cache it it's there. I haven't...

    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
  • RE: I'm sick of poor third-party software performance

    Jeff Moden (12/12/2007)


    No, no... the rant is understood and appreciated. When I first reported to my company, they had and average of 640 deadlocks a day with spikes to...

    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
  • RE: difference between Len() and DataLength()

    Depends what you want. I doubt there's much of a performance difference, if any.

    Ifyou want the number of characters in the string, except trailing spaces, use LEN. If you what...

    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
  • RE: select data between 2 periods

    With an appropriate index*, the first 2 can do an index seek to get the data. The third, since it has functions applied to the columns, will do at best...

    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
  • RE: SP execution plan

    Paste the call to the proc in QA and run it with the exec plan on. It should give you back the same plan as from whatever app its called...

    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
  • RE: Sub-select vs. cursor + sp_executesql

    Jason Selburg (12/11/2007)


    In 2005, the MERGE command can be used. I'm not 100% on the syntax, but I've read it can be done.

    Afaik, Merge didn't make it into SQL...

    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
  • RE: I'm sick of poor third-party software performance

    Yup. I've seen some nasty stuff from vender software. From 38 indexes in one table, with the same leading column, to 'temporary' tables that don't get dropped (we had 150000...

    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
  • RE: These are the types of questions...

    Brandie Tarvin (12/11/2007)


    Do you know what's wrong with the above scenario?

    Yeah, witness servers aren't exactly expensive. SQL Express and a desktop work just fine.

    :hehe: 😉

    Without a witness, mirroring won't...

    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
  • RE: Deadlock Errors

    Why the recovery interval?

    Also what you can do is change the server-wide max degree of parallelism. I don't rcommend dropping it to 1. What I normally do is set it...

    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

Viewing 15 posts - 48,046 through 48,060 (of 49,552 total)