2012年3月8日星期四

BCP Format File

Hi,
1) How do we specify constant values in BCP Format File?
ex
FileABC -- CONSTANT 1044035814.
2) How do we map one Value to TWO column fields in BCP Format File.
ex -- Data file Value -- "123 ABCDE"
Filed1 -- 123
--
Filed 2.. I want the value to be "AB"
Field 3.. I want the value to be "CDE"
--
Regards
Govardhan MVIf data values are not present in the source file, you need to use DEFAULT
constraints on the columns so that the desired values are inserted instead
of NULL. BCP honors DEFAULT constraints unless overridden with the '-k'
parameter.
Hope this helps.
Dan Guzman
SQL Server MVP
"Govardhan MV" <GovardhanMV@.discussions.microsoft.com> wrote in message
news:F2C48A4F-4500-415F-B439-2D9E61D1518E@.microsoft.com...
> Hi,
> 1) How do we specify constant values in BCP Format File?
> ex
> FileABC -- CONSTANT 1044035814.
> 2) How do we map one Value to TWO column fields in BCP Format File.
> ex -- Data file Value -- "123 ABCDE"
> Filed1 -- 123
> --
> Filed 2.. I want the value to be "AB"
> Field 3.. I want the value to be "CDE"
> --
> Regards
> Govardhan MV
>|||"Govardhan MV" <GovardhanMV@.discussions.microsoft.com> schrieb im
Newsbeitrag news:F2C48A4F-4500-415F-B439-2D9E61D1518E@.microsoft.com...
> Hi,
> 1) How do we specify constant values in BCP Format File?
> ex
> FileABC -- CONSTANT 1044035814.
> 2) How do we map one Value to TWO column fields in BCP Format File.
> ex -- Data file Value -- "123 ABCDE"
> Filed1 -- 123
> --
> Filed 2.. I want the value to be "AB"
> Field 3.. I want the value to be "CDE"
> --
bcp is designed to do fast bulk copy operations. AFAIK there is no such
feature. You might be able to do this with DTS. With that you can define
quite flexible data conversions.
Alternatively preprocess the file with some scripting language tool of
your choice and then do the import with bcp.
Cheers
robert|||Can i Know if i specify the Default constraints , does the performance get
affected ,
our application the performance is very important . we will load millions of
data
at a time. or we have use update statements.
"Dan Guzman" wrote:

> If data values are not present in the source file, you need to use DEFAULT
> constraints on the columns so that the desired values are inserted instead
> of NULL. BCP honors DEFAULT constraints unless overridden with the '-k'
> parameter.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Govardhan MV" <GovardhanMV@.discussions.microsoft.com> wrote in message
> news:F2C48A4F-4500-415F-B439-2D9E61D1518E@.microsoft.com...
>
>|||I doubt you will experience a noticeable performance hit with the default
constraint.
Hope this helps.
Dan Guzman
SQL Server MVP
"Govardhan MV" <GovardhanMV@.discussions.microsoft.com> wrote in message
news:AE8BEA49-4EDF-410D-B8AD-2B212044A2E6@.microsoft.com...[vbcol=seagreen]
> Can i Know if i specify the Default constraints , does the performance get
> affected ,
> our application the performance is very important . we will load millions
> of
> data
> at a time. or we have use update statements.
> "Dan Guzman" wrote:
>

没有评论:

发表评论