用于导入SQL Server数据库的奇怪数据格式

时间:2014-09-24 00:37:47

标签: sql-server sql-server-2008-r2 data-import

我收到了第三方的一组数据。每个数据集分别包含4个文件:

***.CTL
***.dat
***_post.sql
***_pre.sql

我的任务是将这些数据集导入我们的SQL Server 2008 R2数据库。我简要介绍了一个sql文件,注意到" VARCHAR2()"使用数据类型。它可能是Oracel的数据吗?

是否有人熟悉这些格式以及如何将它们导入MS SQL Server?

CTL文件如下:

LOAD DATA 
INFILE 'YVW_DDC_NDWHYDRANTS_DDC.dat'
APPEND INTO TABLE "NDWHYDRANTS_DDC"
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '$$' 
TRAILING NULLCOLS 
( 
NDW_CLASS, 
CSSCLASSNAME, 
G3E_GEOMETRY COLUMN OBJECT 
( sdo_gtype INTEGER EXTERNAL, 
  sdo_srid INTEGER EXTERNAL, 
   isnull FILLER CHAR, 
  SDO_POINT COLUMN OBJECT  NULLIF G3E_GEOMETRY.isnull="pt" 
  ( X INTEGER EXTERNAL, 
    Y INTEGER EXTERNAL, 
    Z INTEGER EXTERNAL), 
  SDO_ELEM_INFO VARRAY terminated by ';' 
    (SDO_ORDINATES char(38)), 
  SDO_ORDINATES VARRAY terminated by ':' 
    (SDO_ORDINATES char(38))) , 
G3E_FID, 
G3E_FNO, 
UNIQUE_ID, 
TYPE, 
OWNER_ID, 
OWNER_FSC, 
RESP_AUTH, 
CONST_DATE, 
RESP_DEVELOPER, 
WARRANTY_EXP_DATE, 
FMS_FILE_REFERENCE, 
SYS_STATE, 
SYS_DATE_CREATE, 
SYS_DATE_LAST_MOD, 
AMG_X, 
AMG_Y, 
ASSET_OWNER, 
HEIGHT )

xxx_pre.sql数据如下所示:

CREATE TABLE "NDWHYDRANTS_DDC" ( 
NDW_CLASS VARCHAR2(1), 
CSSCLASSNAME VARCHAR2(50), 
G3E_GEOMETRY MDSYS.SDO_GEOMETRY, 
G3E_FID FLOAT NOT NULL, 
G3E_FNO NUMBER(10,0) NOT NULL, 
UNIQUE_ID FLOAT, 
TYPE VARCHAR2(80), 
OWNER_ID FLOAT, 
OWNER_FSC VARCHAR2(255), 
RESP_AUTH VARCHAR2(50), 
CONST_DATE FLOAT, 
RESP_DEVELOPER VARCHAR2(50), 
WARRANTY_EXP_DATE FLOAT, 
FMS_FILE_REFERENCE VARCHAR2(50), 
SYS_STATE VARCHAR2(9), 
SYS_DATE_CREATE FLOAT, 
SYS_DATE_LAST_MOD FLOAT, 
AMG_X FLOAT, 
AMG_Y FLOAT, 
ASSET_OWNER VARCHAR2(40), 
HEIGHT FLOAT );

0 个答案:

没有答案