Re: Fast load options in OpenRowset
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 23:12:44 +0000 (UTC)
mweeks (mweeks@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
> I'm loading data that's already in primary key order to a large existing
> table. I hoped to exploit the SSPROP_FASTLOADOPTIONS. About all I can
> find on MSDN is "This property is the same as the -h "hint[,...n]"
> option of the bcp utility". If I use any of the documented hints I get
> an error in the dwStatus property field. e.g. a simple "TABLOCK"...
>
> RFLProperties[0].dwOptions = DBPROPOPTIONS_REQUIRED;
> RFLProperties[0].colid = DB_NULLID;
> RFLProperties[0].dwStatus = DBPROPSTATUS_OK;
> RFLProperties[0].dwPropertyID = SSPROP_FASTLOADOPTIONS;
> RFLProperties[0].vValue.vt = VT_BSTR;
> RFLProperties[0].vValue.bstrVal = SysAllocString ( L"TABLOCK" );
> RFLPropSet[0].guidPropertySet = DBPROPSET_ROWSET;
> RFLPropSet[0].cProperties = 1;
> RFLPropSet[0].rgProperties = RFLProperties;
> hr = pIOpenRowsetFL->OpenRowset ( NULL, &TableID, NULL,
> IID_IRowsetFastLoad, 1, RFLPropSet,
> (LPUNKNOWN *)&pIFastLoad );
>
> The program runs fine if I OpenRowset with zero properties and a NULL
> property set. I've tried "HINT TABLOCK" but that's not right either.
> Anybody, what am I doing wrong? Thanks.
Just a check, you are running VariantInit on RFLProperties[0].vValue,
aren't you?
--
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
.
- Prev by Date: Re: call a function using ado
- Next by Date: Re: Save ADP Connection to UDL -> Data Link file is inaccessible error
- Previous by thread: Re: Null rowset
- Next by thread: Re: Fast load options in OpenRowset
- Index(es):
Relevant Pages
|
Loading