|
|
|
When you bulk import into a SQL Server table or bulk export data from a table, you can use a format file to store format information for each field in a data file relative to that table. A format file provides a flexible system for writing data files that requires little or no editing to comply with other data formats or to read data files from other software programs.
To create format file using bcp command Type the following line on comand Prompt |
It will create file something like this if you have SQL 2005 installed. |
9.0
10
1 SQLINT 0 4 "" 1 ProductID ""
2 SQLCHAR 2 40 "" 2 ProductName SQL_Latin1_General_CP1_CI_AS
3 SQLINT 1 4 "" 3 SupplierID ""
4 SQLINT 1 4 "" 4 CategoryID ""
5 SQLCHAR 2 20 "" 5 QuantityPerUnit SQL_Latin1_General_CP1_CI_AS
6 SQLMONEY 1 8 "" 6 UnitPrice ""
7 SQLSMALLINT 1 2 "" 7 UnitsInStock ""
8 SQLSMALLINT 1 2 "" 8 UnitsOnOrder ""
9 SQLSMALLINT 1 2 "" 9 ReorderLevel ""
10 SQLBIT 1 1 "" 10 Discontinued |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|