How to insert an value to a GEOGRAPHY COLUMN ?

  • Select top 1 GEOG FROM PharmacyProviders

    ( I copied the value from screen and pasted below )

    0xE6100000010C85EB51B81E254540AE47E17A144E55C0

    Then .....

    create table delta( GEOG geography );

    INSERT INTO delta( GEOG ) VALUES ( CAST ( '0xE6100000010C85EB51B81E254540AE47E17A144E55C0' as geography ) );

    The INSERT statement gives me an error.

    Can anyone help ?

  • mw112009 (6/17/2016)


    Select top 1 GEOG FROM PharmacyProviders

    ( I copied the value from screen and pasted below )

    0xE6100000010C85EB51B81E254540AE47E17A144E55C0

    Then .....

    create table delta( GEOG geography );

    INSERT INTO delta( GEOG ) VALUES ( CAST ( '0xE6100000010C85EB51B81E254540AE47E17A144E55C0' as geography ) );

    The INSERT statement gives me an error.

    Can anyone help ?

    You cannot use cast or convert, look up STPointFromWKB in books online.

    😎

    BTW, this binary doesn't look right to me.

  • Should be able to insert as a numeric

    INSERT INTO delta(GEOG) VALUES (0xE6100000010C85EB51B81E254540AE47E17A144E55C0);

    regards,

    Phil

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply