Forum Replies Created

Viewing 15 posts - 1,246 through 1,260 (of 1,424 total)

  • Reply To: Are the posted questions getting worse?

    Lynn Pettis wrote:

    They have to want to help for the encouragement to work.  Not sure how to get someone who really doesn't want to contribute to do so.

    Just a few...

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

  • Reply To: Hierarchies on Steroids #1: Convert an Adjacency List to Nested Sets

    An alternative to nested sets is nested json arrays.  Here it is using Jeff's (small) Employee table (renamed to dbo.Test_Employee)

    drop table if exists dbo.Test_Employee;
    go
    CREATE TABLE dbo.Test_Employee
    ...

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

  • Reply To: Find how many week day crossed in a given date

    To see if DesNorton's solution worked (it does) and to see if the interval could be created in Sql 2012 I tried with this sql although I don't have any...

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

  • Reply To: Importing JSON

    By the way, I did have a script published here on SSC that includes an example of nested json arrays.  Please see:

    https://www.sqlservercentral.com/scripts/function-and-queries-to-convert-hierarchical-adjacency-to-nested-json-arrays

     

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

  • Reply To: Importing JSON

    Json_value() is used to access a single value of up to nvarchar(4000).  Openjson() is used to access arrays and can be nvarchar(max).  In the example json (with array []'s added)...

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

  • Reply To: Importing JSON

    What you posted is not valid json.  The elements of SecondaryData should be in array brackets.

    {
    "odata.id": "0001",
    "MediaId": "0001",
    "SecondaryData": [
    ...

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

  • Reply To: Is this a use case for Graph Database?

    DinoRS wrote:

    Yes there are / will be additional tables where locations and other things will be stored and yes Primary Keys will be introduced as well.

    We have literally no choice...

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

  • Reply To: Need to use Remain value in calculation

    This should come with a warning though.  If there are repeated 'docdata' dates within a partitioning window, then this code will not produce correct results.  If it's possible to implement...

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

  • Reply To: Need to use Remain value in calculation

    select 
    t.*,
    iif((t.totalinvoice+sum(t.totalreceived-t.totalinvoice) over (partition by receipt_nr order by docdata))<0,0,
    iif((t.totalinvoice+sum(t.totalreceived-t.totalinvoice) over (partition by receipt_nr order by docdata))>t.totalinvoice,
    t.totalinvoice, (t.totalinvoice+sum(t.totalreceived-t.totalinvoice) over...

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

  • Reply To: Need to use Remain value in calculation

    Does this produce the correct remainder column?

    select 
    t.*,
    sum(t.totalreceived-t.totalinvoice) over (partition by receipt_nr order by docdata) remainder
    from
    #temptab t

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

  • Reply To: Is this a use case for Graph Database?

    DinoRS wrote:

    Yes, unfortunately it's absolutely not feasible to make changes to the OLTP System where data is inserted initially, it's an 3rd party ISV. All we get is some CSV...

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

  • Reply To: Is this a use case for Graph Database?

    DinoRS wrote:

    the funny part is: If you look at the OLTP DB and their flow it would appear valid (as in: there seems to be no real checks) and when...

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

  • Reply To: Identity column as Primary Key - good or bad?

    Ok - Joe Celko.  Good luck.

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

  • Reply To: Identity column as Primary Key - good or bad?

    Identity() is a piece of automation that solves a set of tricky problems for you.  Choosing not to use it is tantamount to saying you can do it better.  Well,...

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

  • Reply To: Is this a use case for Graph Database?

    DinoRS wrote:

    How would I approach checking the OrderNumbers for validity within the steps so an item in "AU" and locked cannot appear at a different site as next record, same...

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

Viewing 15 posts - 1,246 through 1,260 (of 1,424 total)