Hello
When a COBOL program outputs a "text" file how can SQL Server read that text
file?winlin,
You can import it a number of ways. Read about BCP or BULK INSERT and its
format files. I am assuming that you will need to give some instruction via
the format file about how to parse the "text" file.
Or you may insert it into a staging table with a format something like:
CREATE TABLE CobolStaging
(LineOfCobolText NVARCHAR(1000))
Further, I am assuming that every line is in the same format, so that it can
be viewed as a row in a table. But if that is not the case, then the
reading in is more complex since it would probably be row order dependent
how to interpret the data. (E.g. header rows and detail rows. In that
case, use a table like:
CREATE TABLE CobolStaging
(LineNum INT IDENTITY(1,1)
LineOfCobolText NVARCHAR(1000))
You will need a format file to teach it to skip over the LineNum column when
importing.
After you have read and experimented with BCP you will probably have some
new questions.
RLF
"winlin" <winlin@.verizon.com> wrote in message
news:40E16360-C774-43A6-B4A9-B1B7B5FC4F2B@.microsoft.com...
> Hello
> When a COBOL program outputs a "text" file how can SQL Server read that
> text
> file?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment