Forum Replies Created

Viewing 15 posts - 91 through 105 (of 475 total)

  • RE: The fun factor: Magical numbers and other peculiarities

    Koen Verbeeck (6/17/2014)


    mickyT (6/16/2014)


    One to make you smile if you have 2012:-)

    ...

    Msg 208, Level 16, State 1, Line 3

    Invalid object name 'dbo.DelimitedSplit8K'.

    Sorry, this function is from this article[/url] by Jeff...

  • RE: The fun factor: Magical numbers and other peculiarities

    One to make you smile if you have 2012:-)

    DECLARE @smiley varchar(20) = 'Dont Worry Be Happy';

    WITH Params AS (

    SELECT MAX(CASE WHEN ItemNumber = 1 THEN Val END) OFFSET,

    MAX(CASE WHEN ItemNumber...

  • RE: The fun factor: Magical numbers and other peculiarities

    J Livingston SQL (6/16/2014)


    my effort...too much time on my hands 😀

    DECLARE @Question VARCHAR(100) =

    'The Answer to the Ultimate Question of Life, the Universe, and Everything'

    DECLARE @Source VARCHAR(100) =

    'The Hitchhikers...

  • RE: The fun factor: Magical numbers and other peculiarities

    Promise this will be my last one:Whistling:

    DECLARE @Question VARCHAR(50) = 'Year that England last beat Italy?'

    SELECT CAST(

    POWER(LEN(Italy),ItalyLastScore) *

    POWER(LEN(England),EnglandLastScore) *

    (LEN(@Question) / (ItalyLastScore + EnglandLastScore))

    - (ItalyTotalWins - EnglandTotalWins)

    - (TotalDraws /...

  • RE: The fun factor: Magical numbers and other peculiarities

    Without wanting to pick on any nation in particular;-)

    SELECT TeamName + ': '+ CAST(Score AS VARCHAR(2))

    FROM (VALUES ('England'), ('All Blacks')) team (TeamName)

    CROSS APPLY (

    ...

  • RE: The fun factor: Magical numbers and other peculiarities

    To stick with a theme 🙂

    DECLARE @Team1 VARCHAR(10) = 'Italy'

    DECLARE @Team2 VARCHAR(10) = 'England'

    SELECT @Team1 + ': ' + CAST(LEN(@Team1) % 3 AS VARCHAR(2)),

    @Team2 + ': ' + CAST(LEN(@Team2) %...

  • RE: I Gotta See the Code

    Must read question properly before answering. Missed the pick 3 😀 .... again. Time for coffee.

    Good question Andy

  • RE: Count the number of overlapping dateranges

    I avoid that create/design view window myself. It has a tendency to get itself mucked up and I don't particularly like the way it formats things. Though I...

  • RE: Count the number of overlapping dateranges

    Good to hear you worked it out 🙂 Another option is to build a physical Tally[/url] table or use a construct like the following

    WITH base10 (N) AS (

    ...

  • RE: Access Granted or Not?

    Also good question, thanks Andy

  • RE: Access Granted or Not?

    Mighty (6/3/2014)


    Eirikur Eiriksson (6/2/2014)


    lack of industrial strength tanker sized espresso in the morning:-D

    😎

    +1

    Missed the "(select 2)".

    +1 on the missed 1:-D

  • RE: STintersect with buff

    Hi All

    I've generally found the STContains is no better performing than STIntersects and in some cases worse as it needs to verify that an object in completely enclosed.

    I have also...

  • RE: STintersect with buff

    Johnny H (5/28/2014)


    Thank Jason this increased the speed 10 fold

    SELECT s.ID

    FROM v_sign s

    WHERE EXISTS (SELECT 1 FROM dbo.water w WHERE (geography::STGeomFromText(s.geometry.STAsText(), 4326).STBuffer(100).STIntersects(w.geography) = 1)

    Are you able to post up some...

  • RE: STintersect with buff

    Johnny H (5/27/2014)


    Hi Everyone

    The STDistance will not work well because it will cause too many calculation. I am going to look into the Nearest Neighbor method.

    The trick...

  • RE: STintersect with buff

    Hi

    I've had a look at a few options and for the data the I'm testing on, this appears to be the best solution (for SQL 2012 +). It is...

Viewing 15 posts - 91 through 105 (of 475 total)