Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: Search if IP is in range

    BRILLIANT!!

    Thanks a lot 😉

  • RE: Last 10 run of a script

    this

    RN = 11 - ROW_NUMBER() OVER(PARTITION BY HostIp ORDER BY CreateDate DESC)

    creates a ranked list based on the ip

    then, all you needed to do is pivot the table!!

    GREAT!!

    THANKS 😉

  • RE: Last 10 run of a script

    GREAT!!!! 😀

    I knew it was a matter of pivoting...but couldn't figure out how to deal with the dates...

    do you mind to give an explanation? I think i sort of understood...

  • RE: Cursor within a UDF

    Well..i know how recursive CTEs work 😀

    i am interested in the select on the rCTE.

    Anyway... now it works on the real problem as well 😉

  • RE: Cursor within a UDF

    and it's going to take me quite some time to adapt it to real tables and rules (as i mentioned, i proposed here a simplified version) but this is something...

  • RE: Cursor within a UDF

    Brilliant!!!

    😉

    works like a charm

  • RE: Cursor within a UDF

    I think this is not a problem that can be solved with a set based programming language. Gianluca, your solution doesn't work. Returns the correct values for 1.1.1.1 but fails...

  • RE: Cursor within a UDF

    Well... go on then 😉 i'm working on a solution as well 🙂

    hey wait... i still have to test your last solution 😛

  • RE: Cursor within a UDF

    i think i'm going back to cursors.

    do you have any idea why my first solution returns a null?

  • RE: Cursor within a UDF

    hallidayd (10/14/2010)


    That will be due to the dbo.Test, whatever that is.

    Test is the function

  • RE: Cursor within a UDF

    mind that:

    there might be more than 2 occurrences

    there might be more that 2 iteration

    i.e.

    1.1.1.1 ...

  • RE: Cursor within a UDF

    This function

    BEGIN

    --declare @tmpresult nvarchar(50)

    declare @result nvarchar(50)

    if...

  • RE: Cursor within a UDF

    Sorry guys... can't get the hang of it.

    hallidayd i get an error, can you explain me how your snippet works? AFAIK coalesce need more than just one argument

    I'm now giving...

  • RE: Cursor within a UDF

    hallidayd (10/14/2010) you have come to the conclusion the best solution uses a cursor, but it doesn't

    I see!! 😉

    Thanks, i'll do some test with the posted code! 🙂

  • RE: Cursor within a UDF

    Uhmm...not sure i made myself clear 🙂

    Anyway: this is a simplified version of the working UDF

    create function [dbo].[alias2dnsname]

    (

    @alias nvarchar(50)

    )

    returns nvarchar(50)

    as

    BEGIN

    declare @tmpresult nvarchar(50)

    declare @result nvarchar(50)

    if exists(select * from dnszone as D...

Viewing 15 posts - 1 through 15 (of 16 total)