Forum Replies Created

Viewing 15 posts - 811 through 825 (of 1,413 total)

  • Reply To: Towards an efficient interface between application and database

    One way or another I would like to come up with a way to deal with JSON schemas.  If I observe how my time is spent and do the "5...

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

  • Reply To: Using hierarchyID

    luissantos wrote:

    but my point is that I don't want to assign a value to a variable to start creating hierarchies for all accounts in my chart of accounts. Any ideas...

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

  • Reply To: Using hierarchyID

    Well, I'm not really experienced with hierarchyid other than fiddling around with it.  Most of what can be accomplished with hierarchyid can also be done in various other ways.  In...

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

  • Reply To: Find MAX value from another table

    with t2_latest_cte as (
    select *, row_number() over (partition by RunDate
    ...

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

  • Reply To: Can I use UNPIVOT

    When I run each query and include the actual execution plan the results are identical.  Both do one table scan and a constant scan on the results.  So yes they...

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

  • Reply To: Can I use UNPIVOT

    drop table if exists #Customer
    go
    create table #Customer(
    CIDint not null,
    WholeSaler bit not null,
    ReSalerbit not...

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

  • Reply To: ? on Setting default value to Year of previous month

    select year(eomonth(getdate(),-1))

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

  • Reply To: MERGE with (SERIALIZABLE) deadlocks occasionally

    giga123 wrote:

    Thanks for the suggestions. I am still curious to know why the MERGE statement deadlocks though. Any ideas?

    The way to restrict the number of rows the MERGE is applied...

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

  • Reply To: Daily Counts by Month based on Start/End date

    Since you're counting across months the quick way to generate the daily rows would be to use a tally function.  This uses dbo.fnTally which see this link for details. ...

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

  • Reply To: Different average duration for update with primary key

    It's impossible to say with certainty but perhaps there's another process which causes locking?

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

  • Reply To: Using If exists trying to assign the value to a variable when it exists.

    Maybe you're looking for something like this

    Declare @PalletContent table (ID                int,
    ...

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

  • Reply To: MERGE with (SERIALIZABLE) deadlocks occasionally

    If the MERGE throws an exception is there a rollback?  Could you post the whole procedure?  Is the lock still an issue or it's inconsistent?  Broken MERGE statements are a...

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

  • Reply To: API Newbee

    Receiving JSON and putting it in SQL tables (and the reverse) is pretty much what my job entails these days.  It seems like there ought to be an SSIS way...

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

  • Reply To: Put something into each row in a GROUP BY statement

    Step 1 could be to summarize by the concatenation of MODEL and VARIANT.  Then further summarize by year (årgang) and use STUFF+FOR XML to aggregate the concatenation of MV_ANTAL and...

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

  • Reply To: SQL - How to compare data of a column while iterating row by row and insert new

    Hi there -- thank you for the points 🙂  It wasn't clear to me it's OK to use the uniqueid to order the results.  Windowing functions are permitted in the...

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

Viewing 15 posts - 811 through 825 (of 1,413 total)