Search code examples
sqlsql-serverdatabaseexportbcp

How to inspect a *.bcp file content?


I have an export from a (not mine) application that has extension bcp.

Assuming it was created with the BCP Utility (Bulk Copy Program), how can I check its content, without importing it or installing SQL-server?

I have no schema, just want to ensure what data is present inside, and if I try to open the file with a text editor I just see numerical data (e.g. first line is 5351 4c69 7465 2066 6f72 6d61 7420 3300).


Solution

  • A .bcp extension is generally meaningless (I know of no mainstream application requires this extension). The .bcp extension is generally used by folks to denote that the file was either created by the BCP application (contains data extracted from SQL Server) or that the file is meant to be loaded into SQL Server using the bcp application. But the BCP application cares not for your file extensions. It will try to load or create a file by any name you give it.

    Files created by or used by the BCP program are typically just plan text files. You can view them with any text editor. However, there is an option when using BCP to copy data out of SQL Server to create the file in the native SQL Server format. This will look like gobbldy-gook to the human eye. The data is only meant to be read by SQL Server in it's native data format. This is used sometimes to speed up ETL tasks. It may be that this is how your file was created... by whoever created it. I know of now way to view that data other than to load it into a table that is designed to hold the data.

    Is it possible that the file is truly a plain text file and that the numbers you see are what the data is supposed to look like?