how to optimize sending data to DB

ol muser
ol muser used Ask the Experts™
I need to store a chunk of text data in the database. I need to split long text in to multiple records and store them along with the string order. This way I avoid disturbing the page size of the DB. And we don't want to use the TEXT datatype and want to stick to varchar.

But I am confused if I should split the text on the client side or on the database side.

Which is better - sending a big chunk of data in one DB call over the network or using multiple DB calls with smaller chunks (< 255) ?

thanks in advance

environment: c#, .net 3.5, sybase ase 15
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

You can do it both way. If you want to chunk it in client side then you need to make multiple database call. Which will take time to execute but moe chances of success. But if you want in database side then there is some code where you can set the connection timeout so that you can avoid connection error. Better to chunk data in client side.
I would just do it where it is easier and this might be on the server, but you might have to use a loop (cursor) to number each chunk.  So if you find cursor's difficult, then do it on the client.  Speed might be a non issue.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial