sql server - Why is a text file generated by a SQL job double the size of a manually created one? -
i have sql job running generates data on daily basis , amends text file data.
if copy data out sql generated text file (currently 24kb) new text file, why new text file 12kb?
i'm trying maniplate file using batch script , work if copy out data sql generated new file (the smaller one) why came across it.
when text file unexpectedly double in size (i.e. contains 1000 characters occupies 2000 bytes on disk), it's because it's encoded full 2-bytes-per-character unicode represntation rather ascii, or unicode scheme aims save bytes (like utf8) encoding characters using mix of byte ranges (e.g. utf8 1 4 bytes, aim characters 1 byte)
if want see more, open both files in hex editor; make instantly clear surplus bytes have gone in double size file
Comments
Post a Comment