STGeomFromText
STGeomFromText is a constructor used in SQL Server’s spatial types to create a geometry or geography instance from a Well-Known Text (WKT) representation. It is provided as a static method on both the geometry and geography data types and requires two arguments: a WKT string and an integer SRID that defines the spatial reference system.
There are two supported forms of the function. For geometry, use geometry::STGeomFromText(wellKnownText, srid). For geography, use
The WKT input must conform to the Well-Known Text standard. Examples include 'POINT (30 10)', 'LINESTRING (30
SRID specifies the spatial reference system used for the geometry or geography. A valid SRID is required,
Examples of usage include: SELECT geometry::STGeomFromText('POINT (1 2)', 0); and SELECT geography::STGeomFromText('POINT(-122.349 47.651)', 4326). After construction,