Forum Replies Created

Viewing 15 posts - 4,111 through 4,125 (of 49,552 total)

  • RE: writing queries that easily readable

    We can compensate for badly written code with more badly written code. Excellent plan.

    Correctly terminate all statements with a semicolon (they're statement terminators). The end.

    If someone did not correctly...

    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: writing queries that easily readable

    xsevensinzx (12/2/2015)


    Don't forget to put it at the beginning of each CTE too.

    !Gah !No

    .A semicolon is a statement *terminator* .It is not something that gets placed at the beginning of...

    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: how to use multiple result set from a procedure inside other procedure

    Then you may just have to re-implement the code from Proc 1.

    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: how to use multiple result set from a procedure inside other procedure

    ravi@sql (12/2/2015)


    yes you can, but how will you do that ?

    In procedure 1, create three temp tables. In procedure 2, insert into those temp tables. Back in Procedure 1, use...

    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: how to use multiple result set from a procedure inside other procedure

    Justin Manning SA (12/2/2015)


    Could you store them in a table variable?

    It would need to be a temp table, because table variables have a scope of the current procedure only,...

    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: Improve sql server logs

    You can't change the default trace.

    What you can do is turn the default trace off and create your own trace which logs what you want. I recommend using Extended...

    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: Do You Have Scary Code?

    TomThomson (12/1/2015)


    For a serious chunk of software, you need to star from "write five dozen tests" - and then use the one (ones if you are lucky) that tells you...

    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: Caching database

    Caching's typically done either in the application server or a cache between the app server and the DB. Caching's not something you can just plug in and go, you need...

    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: Transfer Database Task

    To be honest, I'd suggest debugging the backup solution. Transfer's not something that I'd recommend using except for downgrading a database. It's also a lot slower than backup/restore (it scripts...

    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: DECLARE table variable explicitly or by using type?

    You'll probably find the time difference to be utterly meaningless and under the error range for measuring duration of statements. Worrying about a couple microseconds here or there is likely...

    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: Performance with Referencing or not referencing, index or with index?

    shamshad.ali (12/2/2015)


    Do you want me to add another index non clustered (Detail.Id, Detail.MasterId)?

    No.

    I said if there is no existing index on the Detail table on MasterID, create one on...

    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: How to avoid Data Purging?

    Ok, so either run the purging in quieter times, or in smaller chucks or fix the query and indexing problems that's causing queries to be slow.

    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: SQL 2008 R2 - Check DB Fails - Msg 8992, Level 16, State 1, Line 1 Check Catalog Msg 3853

    Ah, I thought it was the other way around. Ignore them (they're harmless except for causing checkDB to fail) or rebuild the DB (script, export, recreate).

    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: SQL 2008 R2 - Check DB Fails - Msg 8992, Level 16, State 1, Line 1 Check Catalog Msg 3853

    What object has an ID of 12331604?

    And check all the other IDs being reported from CheckDB too.

    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: Where is Error 18456 coming from?

    If the trace shows it's coming from SQL, then it's coming from SQL. It's not bogus, the trace is telling you what application name the client is passing. Is there...

    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 - 4,111 through 4,125 (of 49,552 total)