Forum Replies Created

Viewing 15 posts - 571 through 585 (of 1,414 total)

  • Reply To: GUIDs as clustered index

    Thank you Jeff.  On some projects we've had logical/physical GUID issues (or idk what to call it, let's say it's the subject of ongoing analysis) which we've sort of managed...

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

  • Reply To: GUIDs as clustered index

    vsamantha35 wrote:

    So, they came up with a workaround as below.

    - Introduced a new column as BIGINT column.

    - Made the bigint column as NOT NULL IDENTITY(1,1) with clustered index on it

    -...

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

  • Reply To: How show only first friday of every month

    Jeff Moden wrote:

    Good idea but I'm hoping that you don't think that I didn't know that. 😀  It doesn't matter as much as it did before but there used to be...

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

  • Reply To: How show only first friday of every month

    Ha, nice Jeff.  @@DATEFIRST returns 7 on my test instance so no worries there.  In the tvf it seems possible to factor out a common table expression and the UNION...

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

  • Reply To: How show only first friday of every month

    Jeff Moden wrote:

    I'd be real careful with that.  It uses the WEEKDAY date part, which is subject to change and most recommend not using it for such calculations.  I avoid its...

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

  • Reply To: How show only first friday of every month

    Jeff Moden wrote:

    Heh... one good test result is worth a thousand expert opinions.  😀

    This 🙂

    ScottPletcher wrote:

    Steve Collins wrote:

    You ran a comparison?

    Would we need to?  A single math calc vs iterating thru string...

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

  • Reply To: How show only first friday of every month

    Jonathan AC Roberts wrote:

    I've amended your code. I think this should be a few times faster as it removes the need for a tally of 7 week days and just calculates the...

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

  • Reply To: How show only first friday of every month

    Here's another version which replaces the second dbo.fnTally tvf with an explicit values table (0-6) and which eliminates the outer WHERE clause by adding the row filter to the final...

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

  • Reply To: How show only first friday of every month

    Thank you Jeff.  It's my pleasure of course.  Please let me know if there's anything else I could do

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

  • Reply To: How show only first friday of every month

    You ran a comparison?

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

  • Reply To: How show only first friday of every month

    Fwiw in 2021.  In the FROM clause use dbo.fnTally and CROSS APPLY (both twice) to hierarchically generate the first 7 days of each month.  Then in the WHERE clause filter...

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

  • Reply To: Get value of rows based on condition

    It's a lot going on.  The query splits the rows into "gap and island" groupings labelled 'grp'. Within each grouping the CTE 'top_c_cte' selects the largest CA value when Stat='C'. ...

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

  • Reply To: Issue with the SUM function

    It's not really a conclusive test.  Maybe you're missing a JOIN condition on location?  Is there a column in the SCPOMGR.DMDUNIT table which correlates to the 'LOC' column in the...

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

  • Reply To: Issue with the SUM function

    Maybe the INNER JOIN between SCPOMGR.FCSTPERFSTATIC AS F and SCPOMGR.DMDUNIT AS D on the 'DMDUNIT' column could be causing row expansion.  Would you expect this query to return zero rows?

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

  • Reply To: Please delete

    Vielleicht sowas

    with upd_cte(SUM_KBABenoetigteZeit, pm_extended_id) as (
    select sum(TCompl.usr_KBABenoetigteZeit), PMProc.pm_extended_id
    from rm_task_completion TCompl
    ...

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

Viewing 15 posts - 571 through 585 (of 1,414 total)