Applied to SQL Server 2005 or later
Define MapKML as XML data type in table tblMap
DECLARE @xmlFileName VARCHAR(300)
SELECT @xmlFileName = 'D:\GoogleMaps\YourMap.kml'
EXEC('
INSERT INTO tblMap(MapName, MapKML)
SELECT ''Your map'', xmlData
FROM
(
SELECT *
FROM OPENROWSET (BULK ''' + @xmlFileName + ''' , SINGLE_BLOB) AS XMLDATA
) AS FileImport (XMLDATA)
')
Monday, December 7, 2009
Import Google map KML file into a table
at 9:56 PM
Labels: SQL Server 2005, SQL Server 2008, SQL Server Tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment