Jane Dallaway

Jane Dallaway

Jane Dallaway  //  Service Delivery manager, photographer, dog owner, gardener, reader, learner, software developer and occasional snowboarder

This blog contains all sorts of bits and bobs, from development related stuff, through process and productivity stuff, to photography stuff, and general inspiration things. It's a bit all over the place with no real theme, but then so am I

Email: jane @ dallaway.com
Also at:    

spu_generateInsert - PRINT statement limitation worked around

Further to my earlier update today I've reworked the printing out of the insert statements - mainly because I need it for the work I'm doing today...

It now produces a single statement per row of data, and then checks the DATALENGTH of that statement. If it exceeds the 8000 byte limit, then it looks for CHAR(10)/CHAR(13) characters and breaks the row into chunks based on these CHAR(10)/CHAR(13) limits.

This relies on the fact that
PRINT 'Hello ' + CHAR(13) + 'World'
and
PRINT 'Hello'
PRINT 'World'

both produce the same output of
Hello
World

So, instead of PRINTing CHAR(13) we're PRINTing multiple lines.

All of which seems to work and I can finally get the

As per usual, download the spu_generateInsert script here.

0 comments

Leave a comment...