Kliver Max
Kliver Max

Reputation: 5299

How to update table with data from same table?

There is table in SQL-Server:

Track(
 id uniqueindeficater,
 Track geography,
 the_geom geometry
)

Now i want take Track column and put this data into the_geom column converting it from geography to geometry data type. SOmething like this:

GEOMETRY::STGeomFromText(Track.Track.STAsText(),4326)

How can i update column using data from same table?

Upvotes: 0

Views: 149

Answers (2)

Gordon Linoff
Gordon Linoff

Reputation: 1269463

Doesn't this work?

update track
    set the_geom = GEOMETRY::STGeomFromText(Track.Track.STAsText(),4326)

Upvotes: 1

MiMo
MiMo

Reputation: 11953

Something like this:

update
  Track
set
  the_geom = GEOMETRY::STGeomFromText(Track.STAsText(),4326)

Upvotes: 2

Related Questions