PC Geo informatie -> MS SQL

Naar aanleiding van thread “Ik kom ftp.foonsearch niet op ?!” hier een manier om de PC6 Geografische Informatie naar MS SQL te zetten.

STAP 1
Dump de geografische data naar text bestand:
fd05-csv “d:\Install\program files\De Telefoongids\CD-foongids\Data” geo
(zie
http://www.foondump.nl/Index.php?page=gebruik-csv
)

STAP 2
Maak een tabel aan op de MSSQL server volgens dit script:

[quote]if exists (select * from dbo.sysobjects where id = object_id(N’[dbo].[mssql_pcgeo]‘) and OBJECTPROPERTY(id, N’IsUserTable’) = 1)
drop table [dbo].[mssql_pcgeo]
GO

CREATE TABLE [dbo].[mssql_pcgeo] (
[PC6] [char] (6) COLLATE Latin1_General_CI_AI NULL ,
[x] [int] NULL ,
[y] [int] NULL ,
[lat] [numeric](11, 8) NULL ,
[lon] [numeric](11, 8) NULL
) ON [primary]
GO[/quote]

STAP 3
Importeer de data van de tekstfile naar de tabel:
a) [Tables][All Tasks][Import Data]
b) data source: = tekstfile. Kies voor fileformat=delimited, text qualifier=none, columndelimiter=|
c) data destination = tabel mssql_pcgeo

Runnen maar. MSSQL zet automatisch de string waarden van lat/lon om in numerieke waarden.

Raymond

Kijk, daar word ik blij van. :smiley:

Is er ook nog iemand die me een .fmt file kan geven om stap 3 te automatiseren, dan pas ik de distro aan!