SQL Server BULK INSERT
You can do this using the BCP format parameter. This will create a format file of the table for you.

Based on your requirement, you can create XML/native/character formatted files.

eg: bcp db_name.schema_name.table_name format nul -T -n -f format-file.fmt