Tuesday, March 27, 2012

Can we do the Validations in bcp format file

Hi
I need few clarifications. I am using bcp 9.0 tool to load the data into the
table in SQL Server 2005.
Can we do validations in bcp format file.
The validations like
1. if the datafile field data is "ABC" I want to insert the data into table
as "DEF" or if the datafile field data is "123" I want to insert the data
into table as "456" .
2. Format the date filed and insert the formated date data into table column
.
3. Assign default values or Constant values for the columns of the table,
the data for those fields are not exist in the date file
Thanks in Advance
Regards
VeeruVeeru (Veeru@.discussions.microsoft.com) writes:
> I need few clarifications. I am using bcp 9.0 tool to load the data into
> the table in SQL Server 2005.
> Can we do validations in bcp format file.
> The validations like
> 1. if the datafile field data is "ABC" I want to insert the data into
> table as "DEF" or if the datafile field data is "123" I want to insert
> the data into table as "456" .
> 2. Format the date filed and insert the formated date data into table
> column.
> 3. Assign default values or Constant values for the columns of the table,
> the data for those fields are not exist in the date file
I've answered this question in .tools. Please don't post the same question
independently to multiple newsgroups.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

No comments:

Post a Comment