2012年2月18日星期六

BCP - BULK INSERT - Memory mapped files

Hi,
I have an application server which receives several thousand events per
second. And it needs to store that data in an SQL server running on a
separate server connected thru network to the application server. I would
like to know the fastest and the efficient way to store the data in to SQL
server tables.
I looked in to BCP and BULK INSERT, but the question is how do I move the
data file(presumably created by the application server) to the SQL server to
use with BULK INSERT? I can probably create the file locally on the
application server, and use bcp_execute etc programatically, but is this the
best way? Since the data is already in the application memory, is it possibl
e
make bcp_execute access the in-memory data, using memory-mapped file or some
such thing?
Thank you for your help, SriniCheck SqlBulkCopy class in msdn or .Net documentation.
You can feed it with any object (WriteToServer method) implementing
IDataReader
HTH
"Srini" <Srini@.discussions.microsoft.com> wrote in message
news:AB6E2972-4C04-47AE-BA3D-1BF7EEE827A5@.microsoft.com...
> Hi,
> I have an application server which receives several thousand events per
> second. And it needs to store that data in an SQL server running on a
> separate server connected thru network to the application server. I would
> like to know the fastest and the efficient way to store the data in to SQL
> server tables.
> I looked in to BCP and BULK INSERT, but the question is how do I move the
> data file(presumably created by the application server) to the SQL server
> to
> use with BULK INSERT? I can probably create the file locally on the
> application server, and use bcp_execute etc programatically, but is this
> the
> best way? Since the data is already in the application memory, is it
> possible
> make bcp_execute access the in-memory data, using memory-mapped file or
> some
> such thing?
> Thank you for your help, Srini|||I am not using .Net Framework in my code. I need a solution using ODBC or BC
P
API. etc.
Thanks for your help.
"AlexS" wrote:

> Check SqlBulkCopy class in msdn or .Net documentation.
> You can feed it with any object (WriteToServer method) implementing
> IDataReader
> HTH
> "Srini" <Srini@.discussions.microsoft.com> wrote in message
> news:AB6E2972-4C04-47AE-BA3D-1BF7EEE827A5@.microsoft.com...
>
>|||Look up bcp_bind and bcp_sendrow in MSDN
"Srini" <Srini@.discussions.microsoft.com> wrote in message
news:62EB5419-1361-40BA-A66E-40EC2817A5BC@.microsoft.com...[vbcol=seagreen]
>I am not using .Net Framework in my code. I need a solution using ODBC or
>BCP
> API. etc.
> Thanks for your help.
> "AlexS" wrote:
>

没有评论:

发表评论