Use a SELECT...FROM OPENSTRING statement – You can execute a SELECT... FROM OPENSTRING statement on a file containing the spatial data. For example:
INSERT INTO world_cities( country, city, point )
SELECT country, city, NEW ST_Point( longitude, latitude, 4326 )
FROM OPENSTRING( FILE 'capitalcities.csv' )
WITH(
country CHAR(100),
city CHAR(100),
latitude DOUBLE,
longitude DOUBLE )
Create coordinate points by combining latitude and longitude values – You can combine latitude and longitude data to create a coordinate of spatial data type ST_Point. For example, if you had a table that already has latitude and longitude columns, you can create an ST_Point column that holds the values as a point using a statement similar to the following:
ALTER TABLE my_table
ADD point AS ST_Point(SRID=4326)
COMPUTE( NEW ST_Point( longitude, latitude, 4326 ) );