Forum Replies Created

Viewing 15 posts - 5,776 through 5,790 (of 49,552 total)

  • RE: Tuning expensive query II

    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    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: The Scientific Method: a call to action

    Kyrilluk (5/26/2015)


    How do you quantify this security risk? Using what research?

    That's an area called "Risk Management". You quantify it by looking at three aspects: threat, vulnerability and asset (at...

    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 constraint' on group of records

    pdanes (5/25/2015)


    If at all, it would have to be done in an update query that simultaneously changed both records in one statement.

    Correct, it would.

    Maybe instead have a daily (hourly) job...

    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: Disable and Enable trigger

    No, that's sufficient.

    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 temp tables are assocated to deffred recompilation.

    What problem? Deferred compile isn't a problem, it's a feature.

    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 constraint' on group of records

    CREATE UNIQUE INDEX idx_TableOfClovekNames_ClovekAutoID

    ON TableOfClovekNames (ClovekAutoID)

    WHERE JeHlavni = 1

    The unique requirement on that only applies to rows where JeHlavni is 1, and it forces that there may not be more...

    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 do a Monthly Average on my SQL DB

    You're welcome

    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: Tuning expensive query

    Just a word of advice, that blog post's conclusion is wrong.

    SQL Server could still very well hold 2GB of table in memory – but it doesn’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: 'Check constraint' on group of records

    I would use a filtered index for that (well, part of that).

    You want to ensure that there is only ever one row with JeHlavni = 1 for each ClovekAutoID,...

    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 do a Monthly Average on my SQL DB

    sherm (5/25/2015)


    and of course the SQL was Smarter than me.;-) it knows that June only has 30 days NOT 31.:-D

    🙂

    When doing date filters like this, always do a >=...

    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 do a Monthly Average on my SQL DB

    sherm (5/25/2015)


    Have also done this for a weekly Average....

    select AVG(total_liters), AVG(total_dollars), AVG(price_a_liter)

    from Petrol_Table

    where FuelDate >= '2014-06-01' and fueldate <= '2014-06-07';

    btw, that's wrong for a weekly average. That's going 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: how to do a Monthly Average on my SQL DB

    sherm (5/25/2015)


    if i just want the month, how should i code it.?

    That's what the query I posted does.

    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 do a Monthly Average on my SQL DB

    sherm (5/25/2015)


    but when i tired this...

    select AVG(total_liters), AVG(total_dollars), AVG(price_a_liter) from Petrol_Table where FuelDate like '2014-06%'

    it gave me this result col1 = 38.715, col2=55.8075, col3=143.7

    which is correct, thanks very...

    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 do a Monthly Average on my SQL DB

    sherm (5/25/2015)


    if you have the time, some code would help....

    Err, how am I going to write working code for you when you haven't told me the names of the columns...

    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: Script table and data

    GilaMonster (5/25/2015)


    right click database -> Tasks -> generate script)

    There's an 'advanced' button on the 'Set Scripting Options' tab. In that, select to script schema and data

    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 - 5,776 through 5,790 (of 49,552 total)