Search code examples
sql-serverbulkinsertbcp

Comments in format files


Is it possible to add comments to the non-XML bcp/BULK INSERT format files?

This would be very helpful in scenarios where these files are treated as declarative code--because, well, code needs comments.

Haven't tried anything yet, because I'd just be throwing random chars with possible unforeseen after-effects.

A definitive "no" would be an acceptable answer.


Solution

  • I think the closest to a definitive negative answer is the fact that there is neither a single mention of comments in the documentation nor any examples. I guess there is a specification somewhere in the archives at Microsoft, but it doesn't seem to be available online.

    The clearest definition of the non-xml format I've seen is this image (taken from Structure of Non-XML Format Files):

    Structure of Non-XML Format Files

    For me that is proof enough that comments are not a part of the format and the answer to your question is NO.

    As pointed out in the comment by Katherine Elizabeth Lightsey using the newer XML-based format files might be a better, more flexible option, with the added bonus that the XML-format is pretty much self-describing.