Forum Replies Created

Viewing 15 posts - 286 through 300 (of 475 total)

  • RE: Match Varbinary(max) with another Varbinary(max)

    Hi

    To me it looks like you want to do a & (bitwise AND) on the binaries. Unfortunately for the length of the binaries that you are indicating this will...

  • RE: Split Data

    I may be misunderstanding you requirement, but you could simply change your outer select to do a union all (or union depending on your data)

    select

    r.DIVName1 as [Division]

    ,r.CCYCODE as [Code]

    ,r.title...

  • RE: Transaction Trio

    Nice question thanks

  • RE: SQL Server Spatial - STIntersection

    I thought I would have a go at this with a simplified example. I don't seem to get the behaviour that you are getting? What version of SQL...

  • RE: and x is NULL <> and x = 'NULL'

    I personally loathe the one where something like

    7/21

    gets converted to

    Jul-21

  • RE: Distinct in CTE?

    Hi

    Simplifying you query down, I would expect that you are seeing the following behaviour?

    with simpleExample AS (

    -- A simplified example of what I expect you are seeing from inside...

  • RE: Help with Max function

    Hi

    You could also try (assuming this is a numeric/float column)

    with sampledata as (

    select v

    from (VALUES (1.1), (1.2), (2.1), (2.2), (10.1), (10.2), (10.3)) v (v)

    )

    select v

    from sampledata

    where cast(v as int)...

  • RE: need help and getting unique set

    Hi

    These will probably perform like a dog on larger sets, but here is 2 more options

    SELECT set_id, product, attribute

    FROM #temp t

    INNER JOIN

    (

    SELECT DISTINCT MIN(set_id) minid

    FROM #temp

    GROUP BY product,...

  • RE: Upgrading the GIS application and database.

    Thanks for a good article Hilda.

    I have been hit by different server versions ourselves causing odd behaviour introduced by a service pack. STUnion started returning lines when...

  • RE: Remove Duplicates

    I think this gives the results that you want. Then it's just a matter of wrapping it up in a delete

    select row_number() OVER (order by a.name, a.ord) Row,

    a.Ord,

    CASE When...

  • RE: Converting Non-Spatial Data to Spatial Data

    Sorry for the delay getting back.

    There would be no problem using a Geography in a temporary table

    CREATE TABLE #TempLocation

    (Code Varchar(5) PRIMARY KEY

    ,Location Geography

    )

    INSERT INTO #TempLocation

    VALUES ('OR001',Geography::Point(-95.583394,35.284589, 4326))

    ,('OR002',Geography::Point(-95.583494,35.284579, 4326))

    SELECT *...

  • RE: Converting Non-Spatial Data to Spatial Data

    I suppose if you don't mind manually doing this, you could locate each of your CPTs in Google maps. For each one right click in the map and select...

  • RE: Is overpunch amenable to cross apply?

    dwain.c (8/12/2013)


    Is it too late for me to join the party?

    Not at all and very nice 🙂

    Another variation building on Chris's CHARINDEX and removing the CASE.

    WITH SampleData (A, B) AS...

  • RE: Is overpunch amenable to cross apply?

    ChrisM@Work (8/12/2013)


    SELECT

    NDCNumber,

    IngredientCost = CAST(CASE

    WHEN Trailer IN ('{','A','B','C','D','E','F','G','H','I')

    THEN LEFT(ingredientcost,LEN(ingredientcost)-1) + CAST(CHARINDEX('{','{ABCDEFGHI')-1 AS VARCHAR(1))

    WHEN Trailer IN ('J','K','L','M','N','O','P','Q','R','}')

    THEN '-' + LEFT(ingredientcost,LEN(ingredientcost)-1) + '1'

    END AS MONEY)/100

    FROM ...

    I...

  • RE: Is overpunch amenable to cross apply?

    Hi Drew

    Not sure if I have this right (first time I've heard of overpunch), but this may be what you are after

    -- An inline table function to convert overpunch to...

Viewing 15 posts - 286 through 300 (of 475 total)