I've created a new table in SQL Server Management Studio, which includes a Geography column. Now, I'm trying to enter data in this column using the SSMS UI, but I just can't find the right way of doing it.
So, how can that be done?
The geography spatial data type, geography, is implemented as a . NET common language runtime (CLR) data type in SQL Server. This type represents data in a round-earth coordinate system. The SQL Server geography data type stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates.
To quickly generate an insert statement in SQL Server Management Studio for a table that already exists, right click the table, navigate to Script Table as > INSERT To > New Query Editor Window.
If editing a table cell a la mano just type in
POINT (2.434548 48.858319 4326)
I wouldn't think SSMS natively supports doing this with a nice interface (e.g. a map). Maybe there's some add-on to allow this, or likely some 3rd party app.
If you're happy with doing it in SQL, try this:
UPDATE tableName SET geographyColumn = geography::Point(47.65100, -122.34900, 4326)
Derived from here.
Here are 4 more ways to do the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With