Friday, February 17, 2012

creating extended stored procedure using vs.net 2005 for sql2005

Hi,

web searches give no end of how extended stored procedures can only be written in C++ ( or maybe vb also) .

And that extended stored procedures should be abandonded in favour of CLR framework procedures.

And how most articles explain how to convert ESPs to CLR procedures!!!!!

But I need to pass a non-discript block of binary data, extract pieces of data identified by its offset into the block, data type inferred by offset; into data to be written to the SQL database. These offsets are determinede by mapping (C UNION) to C typedef structures.

This cannot be done by managed code, therefore cannot be done by C++ CLR.

It is also ill suited for C# .

Sounds like a job for C++ extended stored procedure.

But how does one create and deploy an ESP with Visual Studio 2005? All wizards seem to insist on CLR.

Help!?

Boyd

This is an interesting problem, why are you sending in a binary block of data like that instead of disassembling it on the client side?

Thanks,

John

|||

Hi,

The binary block could have in the order of 50 different fields concatinated one byte after another. This binary structure maps to a "c typedef struct " definition.

Legacy systems take such a structure, do a "memcpy" out a communication port, a machine at the other end receives the bytes, assigns a pointer of the appropriate "typedef struct" and by inference knows exactly where the data as and the type ( integer, real, character array of fixed length, .... )

Disembling this stuff on the client side requires round-trips to the server for each and every field - very time consuming - especially when I could easily have 400 such blocks (8000 fields) per second from another machine on the network. Then write each field back if it changes (16000 transactions per second over the network). Might be a performance issue. Much more efficient to forward the block to the sql server once and let it do the ripping and shredding.

No comments:

Post a Comment