Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Loading DB2 CLOB data into SQL Server 2008 R2 SP1 Expand / Collapse
Author
Message
Posted Wednesday, May 30, 2012 2:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 8, 2012 5:49 AM
Points: 4, Visits: 21
We are developing a process that sources a CLOB field from Db2, and inserts it into a SQL Server database.

The CLOB data size can be up to 50MB and it contains data stored in XML format. The aim of the process is 1. To get the data from Db2 into SQL Server 2. To "unpack" the values in the XML, using XQuery 3. To load the "unpacked" values into seperate table columns.

To give some background. The values in the CLOB field contains Importer / Exporter information and is grouped as Commodity items in the Clob field. There will be anything from 1 - 10000 Commodity items and their associated values inside the CLOB field.

For development purposes, the data we received from source was limited to 5 items. Everything looked fine, until they started to increase the number of items sent through. This obvioulsy increase the size of the CLOB field.

The result was that all the CLOB values, where the umber of items exceeded 5 items, were loaded into SQL Server as a NULL value. Just to emphasise, the larger CLOB values are not written to SQL Server, the column is NULL in SQL Server

I am therefore convinced that the size of the CLOB field has something to do with this. I was under the impression that VARCHAR(MAX) could handle up to 2GIG.

We have tried the following things, without sucess.

1. Played around with datatypes CLOB - NTEXT, CLOB - NVARCHAR(MAX), CLOB - TEXT, CLOB - VACHAR (MAX). No luck.

2. We even set up a linked server, and tried doing this wth an Openquery statement. Also no luck.

Is there anything else we should look at, sp_tableoption settings etc. ?

We are not very experienced in SQL Server and SSIS. The client forced us to replatform. Any help would be appreciated. Unfortunately I cannot include more info or code snippets. It is all considered to be sensitive info.







Post #1308160
Posted Wednesday, May 30, 2012 3:12 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 7:46 AM
Points: 3,915, Visits: 5,103
The Large Object data types (viz. VARCHAR(MAX), NVARCHAR(MAX), VARBINARY(MAX) and XML) can cater for up to 2GB of data.

The issue may be with the ODBC or OLEDB connections used by the linked server.


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1308184
Posted Friday, June 1, 2012 7:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 8, 2012 5:49 AM
Points: 4, Visits: 21
Thanks for your post. It was indeed a driver issue.

The correct driver to use is the DB2 OLEDB/.Net provider with the datatype set to NTEXT.

It also is much faster than using OPENQUERY with a linked server to Db2.
Post #1309719
Posted Wednesday, January 23, 2013 10:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 23, 2013 10:14 AM
Points: 1, Visits: 0
Hi,

Could you please let me know a little more detail about the DB2 OLEDB/.net provider driver? I see a bunch of them at our shop. Which vendor provided this driver? IBM or Microsoft? What's the version of the driver?

Thanks !!
Post #1410700
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse