Forum Replies Created

Viewing 15 posts - 241 through 255 (of 49,552 total)

  • RE: Somebody Help! - T-SQL syntax help.

    I strongly recommend you steer away from that inefficient method (and it is going to be really inefficient on larger date ranges), and use a numbers table to generate 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: Monitoring function performance stats

    It's just, afaik, a filtered view of sys.dm_exec_query_stats.

    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: TEMPDB files

    To be honest, I wouldn't configure more than 8 without some evidence of allocation contention. The only time I'd have 24, is if, with 20 files, there was still evidence...

    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: Somebody Help! - T-SQL syntax help.

    mw_sql_developer - Friday, March 23, 2018 10:59 AM

    .  I bet someone who knows recursion can modify that code and do 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: Somebody Help! - T-SQL syntax help.

    You got a calendar or numbers table in your database? If not, can you create one?

    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 am i going wrong with this IF Exist Else

    What error is being thrown, or what is it doing that it's not supposed 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: SQL Server Master Data Services not available in SQL Server 2016 Standard edition with SP1?

    river1 - Thursday, March 22, 2018 5:12 AM

    Thank you for the link.

    It says only enterprise and dev editions support it.

    Correct. It does.
    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: SQL Server Master Data Services not available in SQL Server 2016 Standard edition with SP1?

    https://docs.microsoft.com/en-us/sql/master-data-services/master-data-services-and-data-quality-services-features-support

    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 INTO doesn't update the tables recursively

    Please don't post the same question in multiple places.
    No further replies here please. Replies to:  https://www.sqlservercentral.com/Forums/1928776/SELECT-INTO-doesnt-update-the-tables-recursively

    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: get date by rank

    Using Pietlinden's sample tables above (thanks), this looks like it should give what's wanted.

    SELECT account
      , amt
      , rnk
      , FixDate
      ,...

    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: get date by rank

    If they're datetimes (not strings) it won't matter to SQL what they are. I'm not American, your format confuses me.

    One more thing. What should be returned if 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
  • RE: get date by rank

    So for both of these, it should return the 3rd Feb?

    (22, 200, 2, '01/01/2018')
    (53, 90, 2, '01/04/2018')

    In other words, is the date selected only based...

    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: get date by rank

    select <current columns>, paydate from <whatever tables are in your query>
    CROSS APPLY (SELECT TOP(1) paydate FROM tbldates WHERE tbldates.paydate > payabledate ORDER BY paydate) AS NextPayDate

    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: Upgrade of SQL Server from 2014 to 2017.

    Jason A. Long - Wednesday, March 21, 2018 9:28 AM

    Gail, please correct me if I'm wrong here... but... 
    You can have two...

    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: Dynamic expression in a view

    You're not going to be able to do that in a view. Views can't execute procedures or dynamic SQL. Functions can't execute procedures or dynamic SQL.

    Consider using 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

Viewing 15 posts - 241 through 255 (of 49,552 total)