Enter data in geography column in SQL Server management studio
13,907
Solution 1
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.
Solution 2
If editing a table cell a la mano just type in
POINT (2.434548 48.858319 4326)
Author by
ml123
Senior Software Architect & Consultant, with more than 15 years an an architect of various types of applications. Works with large enterprises as well as small start-ups.
Updated on June 24, 2022Comments
-
ml123 about 2 years
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?
-
Andy Clark over 8 yearsI understand the first 2 parameter in the Point() method are the lat/long and the 3rd is the SRID. However; what does the value 4326 represent? I can not find any info anywhere which indicates what I should specify.
-
Jason Watts over 8 years@AndyClark This query should answer your question. select * from sys.spatial_reference_systems where spatial_reference_id = 4326
-
VSB over 6 yearsIs 4326 belong to special know system, since I've seen it in many examples around the web?
-
Sean Sherman over 6 yearsIt represents WGS 84 - en.wikipedia.org/wiki/World_Geodetic_System
-
Brandon Osborne over 2 yearsThis should be marked as the correct answer!