File Storage Type

The file storage type describes how data is stored in the file. You can copy data into a file as its database table type, as a character string in ASCII format, or as any datatype for which implicit conversion is supported for the datatype. User-defined datatypes are copied as their base types. The following table shows the storage types that can be used with bcp and the abbreviations (if any) that can be entered at the command prompt.

For the most compact storage, use the default; for ASCII files, use char.

Storage type Abbreviation
char c[har]
varchar c[har]
text T[ext]
binary x
varbinary x
image I[mage]
datetime d[ate] *
smalldatetime D
decimal n
numeric n
float f[loat] *
real r
int i[nt] *
smallint s[mallint] *
tinyint t[inyint] *
money m[oney] *
smallmoney M
bit b[it]
timestamp
*    Length is dependent on the data. For example, an int of 23 has a storage length of
    2 bytes plus the prefix and terminator (if any); an int of 5,238,876 has a storage length
    of 7 bytes plus the prefix and terminator (if any).

Giving a type other than char or a datatype that represents an illegitimate implicit conversion causes bcp to fail. For example, you cannot use smallint for int data (you will get overflow errors), but you can use int for smallint.

When integer datatypes (float, money, and numeric) are stored as their database types, the data is written to the file in the operating-system data representation format, rather than in human-readable form.