Forum Replies Created

Viewing 15 posts - 1,981 through 1,995 (of 7,608 total)

  • Reply To: Rebuilding and Reorganizing Indexes

    Jeff Moden wrote:

    If you have some indexes that have woefully low (less than 80% average percent of page fullness [page density]), then rebuild (NOT reorganize) them at 82% to recover the...

  • Reply To: Trying to Extract customer Transacted in two unique merchants

     

    SELECT a.cardnumber, Count(*), Sum(AMT) 
    from transactions a
    where Merchant like '%Google%' or Merchant like '%Microsoft%'
    group by a.cardnumber
    having max(case when Merchant like '%Google%' then 1 else 0 end) =...
  • Reply To: query filter

    here the fieldName 'Status' is 'On' AND filedName 'Subs' isn't 'No' ... only mach 1 would be returned

    But for mach 1, the value for Subs is 'No' in your sample...

  • Reply To: Using AVG but need to ROUND UP

    If you want round up the avg to whole seconds, then you can use CEILING.  If you want to round to a certain number of decimal places, use ROUND.  In...

  • Reply To: Query is hanging

    Melanie Peterson wrote:

    Good observations. The view, like this query, is a mess. It joins 7 tables, including one in a database on another server with a different collation, and another view....

  • Reply To: Query is hanging

    Can you post the query for the view being referenced?  At least I'm assuming that "vwRequests" is a view.  I can't tell what indexes might help this query without seeing...

  • Reply To: Decimal places

    cast(

    case f.HAI

    when 'A' then (isnull(f.NUM,0)/f.DEN) *10000.00

    when 'B' then (isnull(f.NUM,0)/f.den) *1000.00

    when 'C' then (isnull(f.NUM,0)/f.den) *1000.00

    when 'D' then (isnull(f.NUM,0)/f.den) *1000.00

    when 'E' then (f.NUM/f.den) *100.00

    else 0.00

    end as decimal(9, 2)) as 'Rate'

  • Reply To: T-SQL Query select with a heap table without join

    If you're joining to the table, and it currently has no indexes at all, then create a clustered index on the WHERE columns and/or JOIN column(s).

    To give you anything more...

  • Reply To: is value is contained in column - new column

    Please be aware that this is forum for SQL Server dbms.  Your code is obviously for a different dbms.  You might get a better response if you post on a...

  • Reply To: question on Index Rebuilds

    Jeffrey Williams wrote:

    ScottPletcher wrote:

    Yes, sorry, as I stated in passing earlier, what I meant was that you "can't" in practice even if you can in theory because it takes so long...

  • Reply To: question on Index Rebuilds

    Jeffrey Williams wrote:

    ScottPletcher wrote:

    However, if you "don't break the log chain", and something happens after the rebuilds, you WILL lose all data mods after the rebuilds, since you can't forward-recover using...

  • Reply To: Last Column value at the maximum value of Cond Column

    Not a lot of details to go on, so I'll have to assume that the time is the same for the two rows that need brought together.

    SELECT...
  • Reply To: question on Index Rebuilds

    Jeff Moden wrote:

    p.s.  Just in case there's a question about where I stand on this, I DO absolutely agree that taking a dif backup before and after Minimally logged rebuild should...

  • Reply To: question on Index Rebuilds

    Jeff Moden wrote:

    That's not true, Scott.  Not that you should but you can go back to the FULL Recovery Model from the BULK_LOGGED recovery model at any time without any kind...

  • Reply To: question on Index Rebuilds

    Jeff Moden wrote:

    Again, though... they don't need to be full backups.  They can be diffs to save some time and, possibly, reduce the size of backups.

    If you intend to go back...

Viewing 15 posts - 1,981 through 1,995 (of 7,608 total)