0

我似乎找不到这是否可能,我有一个完全平面的文件,我需要组织它以使用 OPENROWSET 导入 SQL 服务器。该文件的示例如下所示:

GRP 3 DTL abc DTL def DTL ghi GRP 2 DTL wxy DTL z

我希望导入数据,这样每个 GRP 都是一条记录,每个 DTL 都是一条记录,如下所示:

GRP 3
DTL abc
DTL def
DTL ghi
GRP 2
DTL wxy
DTL z

在创建格式文件时,我似乎只能将格式文件设置为将“GRP”或“DTL”作为行分隔符,但不能同时使用两者。是否可以设置两个行分隔符?

4

1 回答 1

0

You can't set the row terminator value to a multiple values. However, you may be able to make this work without changing the row terminator. If you set the field terminator to the proper value and add two column definitions in your format file, you should be able to load the data in multiple rows.

于 2012-12-31T16:41:04.317 回答