Forum Replies Created

Viewing 15 posts - 151 through 165 (of 1,193 total)

  • RE: Reseed one table column

    I'll pile on and also agree that in your situation it doesn't sound like there's a pressing need to eliminate gaps; it sounds very much like a solution in search...

  • RE: Disaster Recovery Preparations

    Both losing committed changes and having the data unavailable for any changes are generally undesirable, of course, but the latter is still rather different from losing committed changes.

    Nobody...

  • RE: Distinct query with all columns

    It looks like you're just getting lucky, in this case. A substantial bit of the performance improvement is going to be from implementing the DISTINCT with a hash match instead...

  • RE: Distinct query with all columns

    Yeah, UPPER has some unfortunate side-effects. It's non-SARGable, so limits how supporting indexes can be used.

    Similarly, it also messes with use of statistics, which means it might pick...

  • RE: Are the posted questions getting worse?

    Jason A. Long - Wednesday, July 19, 2017 7:45 AM

    Brandie Tarvin - Wednesday, July 19, 2017 4:39...

  • RE: update column based on max date for each employee

    Another way, assuming we're actually on 2012:

    UPDATE ft
    SET Team_SID=fv
    FROM (SELECT *,fv=FIRST_VALUE(Team_SID) OVER (PARTITION BY Employee_SID ORDER BY CreationDate DESC)
      FROM FactTable) ft

  • RE: How to obtain first, but not empty value?

    I'm guessing what is desired is for each invoice number, return the sum of each of the fare, commission, and gst columns, along with the "first" non-blank passenger_name associated with...

  • RE: Getting Close to the 2017 RTM

    Over all the DBs in the world I wouldn't be surprised if most DBs >=1 TB are non-OLTP, but I work with some OLTP DBs of that size.

    The...

  • RE: Getting Close to the 2017 RTM

    Steve Jones - SSC Editor - Tuesday, July 18, 2017 10:51 AM

    riversoft - Tuesday, July 18, 2017...

  • RE: The Missing Price

    Heh, I hate to be that guy, but now the query actually returns correct results with this particular data because multiply and divide have the same precedence, so they're evaluated...

  • RE: Correlating Forwarded Records / sec to specific Databases/Tables

    Yes, quite likely it is worth it. 

    Those are very high counts and would be affecting performance of the queries involved pretty drastically, unless it was some odd case...

  • RE: Correlating Forwarded Records / sec to specific Databases/Tables

    Yeah, you can use sys.dm_db_index_operational_stats for that.

    Something like this:

    SELECT database_name=DB_NAME(database_id),
       table_name =OBJECT_NAME(object_id, database_id),
       forwarded_fetch_count
    FROM  sys.dm_db_index_operational_stats(NULL,NULL,NULL,NULL)
    WHERE  index_id=0 AND forwarded_fetch_count>0
    ORDER BY...

  • RE: Partition by or Row num or Subquery - Assistance

    There are some decent general techniques for handling this, but I'm still not clear on the logic you want to implement.

    For the Identifier ending in 792, for example,...

  • RE: The Missing Price

    Heh, well, to be fair, the question is incredibly vague. 

    It's "Why do I get the result I get?"

    The are many factors that combine to get this...

  • RE: Partition by or Row num or Subquery - Assistance

    Also, just as a note, please do not post the same topic multiple times. 

    You've posted several versions of this question under sub-forums for different versions of SQL Server.

Viewing 15 posts - 151 through 165 (of 1,193 total)