Forum Replies Created

Viewing 15 posts - 301 through 315 (of 1,419 total)

  • Reply To: Cant extract values from JSON Array

    It's valid JSON.  You could try either with two OPENJSON's or one OPENJSON and 2 JSON functions

    /* two OPENJSON's */
    select SerialNumber, ojc.[value] as ChannelID
    from openjson(@json) with (SerialNumber...

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

  • Reply To: Changing a UDF to a SET BASED QUERY

    Rob Reid-246754 wrote:

    I cannot remember if you are the person who set this site up or not, I know he was called Steve, just forgot his surname.

    That's Steve Jones.  He's the...

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

  • Reply To: LAG function + AVG combined

    As per Phil needs data.  Hmm... either the rows would need to be expanded or dynamic sql?  In order to use ROWS BETWEEN N PRECEDING we're stuck with N being

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

  • Reply To: Changing a UDF to a SET BASED QUERY

    Sorry I shouldn't have wrote that.  I love horses and racing too.  Yes, it passes my visual test now 🙂

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

  • Reply To: Changing a UDF to a SET BASED QUERY

    After looking at it again (and again) it was updated a few times

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

  • Reply To: Changing a UDF to a SET BASED QUERY

    Anyway code could be inferred from what's there.  I don't want to know about horse racing.  Untested you could try

    drop FUNCTION [dbo].[udf_GET_EACHWAY_RETURN_itvf];
    go
    create or ALTER FUNCTION [dbo].[udf_GET_EACHWAY_RETURN_itvf](
    ...

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

  • Reply To: Using a function to parse/return the Nth field of a delimited column

    Oops posted in the wrong spot

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

  • Reply To: Changing a UDF to a SET BASED QUERY

    It not a fully asked question imo.  It's a good one tho.  Hopefully some of that medication was prescribed.  You're looking for more efficient code.  It comes down to demonstrating...

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

  • Reply To: Where clause filter view before dense rank

    Jeff Moden wrote:

    Do you have a good example of an INSTEAD OF trigger for use with UPDATEs?  I've not seen a good one yet.

    It hasn't been necessary for my work so...

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

  • Reply To: Where clause filter view before dense rank

    Jeff Moden wrote:

    Except for the occasional Indexed View, this is one of the many reasons why I hate views.

    Ha my exception is for VIEWS with INSTEAD OF triggers

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

  • Reply To: Where clause filter view before dense rank

    Having performance issues while filtering a view is not uncommon.   Is the view indexed?  How much latitude is there for making changes?

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

  • Reply To: Where clause filter view before dense rank

    Still works

    select *
    from drview
    where field2 = 'x';

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

  • Reply To: Where clause filter view before dense rank

    Works.  Not sure what the issue is

    drop view if exists drview;
    go
    create view drview
    AS
    with cte as (
    select *
    from (values ('x', 'x'), ('x', 'x'), ('x',...

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

  • Reply To: Are the posted questions getting worse?

    Steve Jones - SSC Editor wrote:

    Happy New Year, everyone, and welcome to 2023!

    HNY SSC!  Thank you Steve for being a great host.  All the things 😉

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

  • Reply To: Is there another way to solve this "group in 5 day spans" problem?

    Jeff Moden wrote:

    I could be wrong but that looks like it will do a full scan of the table for each grouping of rows.  Why not just do a single pass...

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

Viewing 15 posts - 301 through 315 (of 1,419 total)