Re: IRowsetFastLoad + Runtime Schema



Chris Trueman (ctrueman@xxxxxxxxxxxxxxxx) writes:
I want to use IRowsetFastLoad to bulk load a MSSQL Server table that's
created at runtime. So I don't know at compile time the structure of the
table. The IRowsetFastLoad example code I've looked at does know the
structure at compile time and so is able to have a ready-made struct for
use as the row buffer.

I need to discover this at runtime and make the row buffer appropriately.

Any suggestions on how this can be done?

I haven't use IRowsetFastLoad, but my experience is that any buffer you
use with OLE DB, has offsets that you set up. Sure, it can be a struct,
but you set the offsets for each field explicitly don't you?

Of course, you also need to map the input file to this, but I assume
that the format of the input file is not known until run-time as well.

As for getting information about the table, there are several options,
including requesting the predifined COLUMNS_ROWSET.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • IRowsetFastLoad + Runtime Schema
    ... I want to use IRowsetFastLoad to bulk load a MSSQL Server table that's ... So I don't know at compile time the structure of the ... I need to discover this at runtime and make the row buffer appropriately. ...
    (microsoft.public.data.oledb)
  • Error in Data Conversion
    ... Sql Server Query:- ... OLE DB provider 'VFPOLEDB.1' supplied inconsistent metadata for a column. ... compile time and 4 at run time]. ...
    (microsoft.public.sqlserver.programming)
  • NCHAR compatibility with Oracle 9
    ... I have a table on a SQL Server 2000 database with a single column of ... I have tried extending the length of the target column still with no ... reported to have a DBTYPE of 129 at compile time and 130 at run time]." ... The client owns the Oracle database and we are not able to change the ...
    (microsoft.public.sqlserver.dts)
  • CDynamicAccessor + IRowsetFastLoad (more...)
    ... I am trying to use CDynamicAccess in conjunction with IRowsetFastLoad to ... works if I know at compile time the structure of the table. ... HRESULT SqlServerBulkDataLoader::OpenDynamicRowsetFastLoad ... // This times and tests inserting rows using IRowsetFastLoad. ...
    (microsoft.public.data.oledb)
  • Linked Server-Oracle
    ... I have a linked server pointing to oracle server 8i on my sql server 2000 box. ... OLE DB provider 'MSDAORA' supplied inconsistent metadata for a column. ... reported to have a DBTYPE of 130 at compile time and 5 at run time]. ...
    (microsoft.public.sqlserver.connect)