Forum Replies Created

Viewing 15 posts - 61 through 75 (of 1,419 total)

  • Reply To: Group records during capture

    Bruin wrote:

    That would be true if working with a Normal date, but the Unix-Timestamp stored in T_stamp needs converted I'm thinking. 

    Yep, t_stamp stored as BIGINT could be converted to DATETIME2(3). ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: The Paradox of NOLOCK: How Dirty Reads Can Sometimes Be Cleaner

    Or the paradox is an enigma wrapped in a riddle.  The article is based on a musing which is factually unconfirmed.  Or maybe I missed the convincing part(s)

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Trigger After Update to Update the Updated Table

    Jeff Moden wrote:

    <b>...</b> the correct criteria to update only those rows that actually have a "1" in the Resolved Column of the INSERTED table.

    Ah ok, this is more correct.  My...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Trigger After Update to Update the Updated Table

    Dennis Jensen wrote:

    Okay I can easily see how to update a table field after an Insert but do I use the system Inserted when creating a trigger to update a field...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: identify consecutive records greater than 1

    with rn_cte as (
    select l.*, v.gt_one,
    row_number() over (partition by Number...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: identify consecutive records greater than 1

    The queries so far don't identify the ranges of consecutive "greater than one" rows.  This query uses two ROW_NUMBER functions which both count up across PARTITION BY Number.  To reset...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Group Delete

    Is CostKey unique in the CostKeyDeletes table?  If so then making it the CLUSTERED key would be preferable.  To log the process you could add an OUTPUT clause to the...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Sql query to check change for an item

    drew.allen wrote:

    I think this approach relies on data quality that isn't necessarily guaranteed.  For instance, if the two statuses were "Presentation" moving to "Approve", the LAG() method would catch it,...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Sql query to check change for an item

    LAG, which compares rows within the window partition, is not strictly necessary imo.  JOIN relates to a lookup table containing the values sequence.  Also, I'm not a fan of ordering...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: A Design Question using a fictious example

    ScottPletcher wrote:

    > What difference the client is a phone? <<

    Because to determine all the Tests that haven't been fully graded could require scanning a very large number of StudentGrade rows.

    If,...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: A Design Question using a fictious example

    eichnerm wrote:

    Thanks for getting back to me.

    I have always been hesitant to use a flag in one table when I could get that same information using a database query. Since...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to manage Time zone changes for countries

    gauravkumar9 wrote:

    To maintain each country's local time, we have collected their respective time zones. Initially, everything worked fine. However, as time passed, some countries requested changes to their time zones...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Generating (semi-)fake purchase data

    Hi pietlinden, maybe you want to generate random prices for a base price of 50, plus or minus 5.  Or maybe you want a base price of 50, plus or...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Generating (semi-)fake purchase data

    You're already generating a series using dbo.fnTally so maybe raise fn.N by an exponent power.  Either POWER or EXP function

    declare @increase_pct      ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Two queries or one?

    Yes so I went with 2 queries.  Just because it's possible to jimmy horn different sets in the WHERE clause doesn't mean it's a good idea

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

Viewing 15 posts - 61 through 75 (of 1,419 total)