Forum Replies Created

Viewing 15 posts - 3,046 through 3,060 (of 7,609 total)

  • RE: View that sums payments by person over a period of years

    Since you've very likely to (almost) always query by trans date, you should change the clustering on the table to:
    ( [transactionDate], [transactionId] )

    That will help performance for...

  • RE: poor performing report query against table without a PK

    ChrisM@Work - Tuesday, November 27, 2018 1:11 AM

    Create this index and check out the plan. I'd expect to see a seek for...

  • RE: If @@error not working with Insert statement

    Certain errors cause SQL to exit the batch, no matter what the code says.

  • RE: How to clean buffer cache without using DBCC command?

    You shouldn't really need to completely flush the buffers.  Comparing Logical I/O should be sufficient, since you can't really know what physical I/O will occur for any given query at...

  • RE: Need help

    But that doesn't match your original request.  You said you wanted "records" (i.e. rows), which would include the Due_time.

    If you need just the client_id and PU, you can...

  • RE: Need help


    SELECT tn.*
    FROM dbo.table_name tn
    INNER JOIN (
        SELECT client_id,PU
        FROM dbo.table_name
        GROUP BY client_id,PU
        HAVING MIN(Due_time) <> MAX(Due_time)

  • RE: Inner joins

    drew.allen - Wednesday, November 21, 2018 11:33 AM

    Jeff Moden - Wednesday, November 21, 2018 9:06 AM

    November 21, 2018 at 12:39 pm

    #2014282

  • RE: Obfuscating character columns

    If you're on SQL 2016, you should use SQL's native data masking capability.  It will easily and efficiently do exactly what you want.

    If that won't work, you could...

  • RE: Index and Search help

    Jonathan AC Roberts - Wednesday, November 21, 2018 8:32 AM

    ScottPletcher - Monday, November 19, 2018 12:53 PM

  • RE: Index and Search help

    (1) Get rid of the ActiveStatus column.  It's useless, and it can cause headaches for the optimizer.  That type of column really is a throwback to tape-based data.

    (2) At...

  • RE: Reindexing and Log files

    No, it's not necessarily a good idea.  In fact, stop it first, then see what's it doing.  If it's using generic rules, like 10% and 30%, then don't restart the...

  • RE: Inner joins

    MS will probably get rid of the old-style joins at some point, but it will likely be a long while, since INNER joins cannot be misinterpreted in the WHERE clause...

  • RE: IsNull to check column

    It can be done using ISNULL().  I'm not trying to say that's necessarily better, just that it can be done, assuming col1 <> col2:


    SELECT ISNULL(NULLIF(ISNULL(col1,...

  • RE: how to find the lowest usage of a database

    Jeff Moden - Wednesday, November 14, 2018 10:45 PM

    WhiteLotus - Wednesday, November 14, 2018 8:49 PM

    November 15, 2018 at 10:21 am

    #2013716

  • RE: Select only one register with condition

    Use "TOP (1)" to limit the results to one row.  For example:


    SELECT TOP (1) Field 
    FROM TABLE 
    ORDER BY Field

Viewing 15 posts - 3,046 through 3,060 (of 7,609 total)