|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Format Files - Bcp
Hi,
I want to write a BCP format file, which uses one data column Value to map to Two Column Fields in the table. For Example: Data File: Pin Value – “5600055†Table Columns 1) tmp_pin 2) per_pin Is the above possible to specify in the format file? Does this flexibility is provided by BCP Utility to load the data. Regards Govardhan MV This type of functionality is best done with DTS.
-- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message I want to write a BCP format file, which uses one data column Value to map news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... Hi, to Two Column Fields in the table. For Example: Data File: Pin Value – “5600055†Table Columns 1) tmp_pin 2) per_pin Is the above possible to specify in the format file? Does this flexibility is provided by BCP Utility to load the data. Regards Govardhan MV HI Tom,
But I want this on BCP not on DTS. Regards Govardhan MV Show quoteHide quote "Tom Moreau" wrote: > This type of functionality is best done with DTS. > > -- > Tom > > ---------------------------------------------------- > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA > SQL Server MVP > Columnist, SQL Server Professional > Toronto, ON Canada > www.pinpub.com > .. > "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message > news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... > Hi, > > I want to write a BCP format file, which uses one data column Value to map > to > Two Column Fields in the table. > > For Example: > Data File: Pin Value – “5600055†> Table Columns > 1) tmp_pin > 2) per_pin > > Is the above possible to specify in the format file? Does this flexibility > is provided by BCP Utility to load the data. > > Regards > Govardhan MV > > What are the datatypes and what are the widths, i.e. how do you map the
5600055 to the two values? -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message This type of functionality is best done with DTS.news:OtOMKfQZFHA.3320@TK2MSFTNGP12.phx.gbl... -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message I want to write a BCP format file, which uses one data column Value to mapnews:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... Hi, to Two Column Fields in the table. For Example: Data File: Pin Value – “5600055†Table Columns 1) tmp_pin 2) per_pin Is the above possible to specify in the format file? Does this flexibility is provided by BCP Utility to load the data. Regards Govardhan MV Hi Tomm
Both the datatype and size are same. Regards Govardhan MV Show quoteHide quote "Tom Moreau" wrote: > What are the datatypes and what are the widths, i.e. how do you map the > 5600055 to the two values? > > -- > Tom > > ---------------------------------------------------- > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA > SQL Server MVP > Columnist, SQL Server Professional > Toronto, ON Canada > www.pinpub.com > .. > "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message > news:OtOMKfQZFHA.3320@TK2MSFTNGP12.phx.gbl... > This type of functionality is best done with DTS. > > -- > Tom > > ---------------------------------------------------- > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA > SQL Server MVP > Columnist, SQL Server Professional > Toronto, ON Canada > www.pinpub.com > .. > "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message > news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... > Hi, > > I want to write a BCP format file, which uses one data column Value to map > to > Two Column Fields in the table. > > For Example: > Data File: Pin Value – “5600055†> Table Columns > 1) tmp_pin > 2) per_pin > > Is the above possible to specify in the format file? Does this flexibility > is provided by BCP Utility to load the data. > > Regards > Govardhan MV > > That's nice. What do you mean by "same" - int, char(5)... ? How about
giving us DDL and how you want the string 5600055 to be divided up? -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message Both the datatype and size are same.news:18508099-5AA8-4C0C-9444-B6198F3DC099@microsoft.com... Hi Tomm Regards Govardhan MV Show quoteHide quote "Tom Moreau" wrote: > What are the datatypes and what are the widths, i.e. how do you map the > 5600055 to the two values? > > -- > Tom > > ---------------------------------------------------- > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA > SQL Server MVP > Columnist, SQL Server Professional > Toronto, ON Canada > www.pinpub.com > .. > "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message > news:OtOMKfQZFHA.3320@TK2MSFTNGP12.phx.gbl... > This type of functionality is best done with DTS. > > -- > Tom > > ---------------------------------------------------- > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA > SQL Server MVP > Columnist, SQL Server Professional > Toronto, ON Canada > www.pinpub.com > .. > "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message > news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... > Hi, > > I want to write a BCP format file, which uses one data column Value to map > to > Two Column Fields in the table. > > For Example: > Data File: Pin Value – “5600055†> Table Columns > 1) tmp_pin > 2) per_pin > > Is the above possible to specify in the format file? Does this flexibility > is provided by BCP Utility to load the data. > > Regards > Govardhan MV > > Tom Moreau wrote:
> That's nice. What do you mean by "same" - int, char(5)... ? How As I understand the question OP doesn't want to split the single string> about giving us DDL and how you want the string 5600055 to be divided > up? but to put the same data into two columns. I wonder though what's the benefit of two columns with exactly the same value... Kind regards robert Show quoteHide quote > >> What are the datatypes and what are the widths, i.e. how do you map >> the 5600055 to the two values? >> >> -- >> Tom >> >> ---------------------------------------------------- >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA >> SQL Server MVP >> Columnist, SQL Server Professional >> Toronto, ON Canada >> www.pinpub.com >> .. >> "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message >> news:OtOMKfQZFHA.3320@TK2MSFTNGP12.phx.gbl... >> This type of functionality is best done with DTS. >> >> -- >> Tom >> >> ---------------------------------------------------- >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA >> SQL Server MVP >> Columnist, SQL Server Professional >> Toronto, ON Canada >> www.pinpub.com >> .. >> "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in >> message news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... >> Hi, >> >> I want to write a BCP format file, which uses one data column Value >> to map to >> Two Column Fields in the table. >> >> For Example: >> Data File: Pin Value – “5600055†>> Table Columns >> 1) tmp_pin >> 2) per_pin >> >> Is the above possible to specify in the format file? Does this >> flexibility is provided by BCP Utility to load the data. >> >> Regards >> Govardhan MV If that's the original intent, I'd wonder myself. Let's get some real specs
and then we can figure it out. -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com .. "Robert Klemme" <bob.n***@gmx.net> wrote in message Tom Moreau wrote:news:uYu%23CUcZFHA.1412@TK2MSFTNGP12.phx.gbl... > That's nice. What do you mean by "same" - int, char(5)... ? How As I understand the question OP doesn't want to split the single string> about giving us DDL and how you want the string 5600055 to be divided > up? but to put the same data into two columns. I wonder though what's the benefit of two columns with exactly the same value... Kind regards robert Show quoteHide quote > >> What are the datatypes and what are the widths, i.e. how do you map >> the 5600055 to the two values? >> >> -- >> Tom >> >> ---------------------------------------------------- >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA >> SQL Server MVP >> Columnist, SQL Server Professional >> Toronto, ON Canada >> www.pinpub.com >> .. >> "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message >> news:OtOMKfQZFHA.3320@TK2MSFTNGP12.phx.gbl... >> This type of functionality is best done with DTS. >> >> -- >> Tom >> >> ---------------------------------------------------- >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA >> SQL Server MVP >> Columnist, SQL Server Professional >> Toronto, ON Canada >> www.pinpub.com >> .. >> "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in >> message news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... >> Hi, >> >> I want to write a BCP format file, which uses one data column Value >> to map to >> Two Column Fields in the table. >> >> For Example: >> Data File: Pin Value – “5600055†>> Table Columns >> 1) tmp_pin >> 2) per_pin >> >> Is the above possible to specify in the format file? Does this >> flexibility is provided by BCP Utility to load the data. >> >> Regards >> Govardhan MV Yes you can define a fixed length file with fixed length fields.
-- Show quoteHide quoteWayne Snyder, MCDBA, SQL Server MVP Mariner, Charlotte, NC www.mariner-usa.com (Please respond only to the newsgroups.) I support the Professional Association of SQL Server (PASS) and it's community of SQL Server professionals. www.sqlpass.org "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... > Hi, > > I want to write a BCP format file, which uses one data column Value to map > to > Two Column Fields in the table. > > For Example: > Data File: Pin Value - "5600055" > Table Columns > 1) tmp_pin > 2) per_pin > > Is the above possible to specify in the format file? Does this flexibility > is provided by BCP Utility to load the data. > > Regards > Govardhan MV > Hi Wayne Snyder,
How do we write the format file for this, Can you please explane me in detail. Data File contain 560030 Table abc a1 b1 are teh columns I want to load 560030 to a1, b1 using BCP . please Help me in writting Format file for this. Regards Govardhan MV Show quoteHide quote "Wayne Snyder" wrote: > Yes you can define a fixed length file with fixed length fields. > > -- > Wayne Snyder, MCDBA, SQL Server MVP > Mariner, Charlotte, NC > www.mariner-usa.com > (Please respond only to the newsgroups.) > > I support the Professional Association of SQL Server (PASS) and it's > community of SQL Server professionals. > www.sqlpass.org > > "Govardhan MV" <Govardha***@discussions.microsoft.com> wrote in message > news:93A5A369-32DA-4859-BAAF-06CB36301C38@microsoft.com... > > Hi, > > > > I want to write a BCP format file, which uses one data column Value to map > > to > > Two Column Fields in the table. > > > > For Example: > > Data File: Pin Value - "5600055" > > Table Columns > > 1) tmp_pin > > 2) per_pin > > > > Is the above possible to specify in the format file? Does this flexibility > > is provided by BCP Utility to load the data. > > > > Regards > > Govardhan MV > > > > >
Other interesting topics
sql data corruption
Images and PDF's in the same DB or in another DB? how to resolve deadlock issues Differential and Transaction backup restore. Problem with different version of SQL Server validate data of target database against source database structure..How? Restore needs too much space List all the logins that have a certain privileges Do I still need pagefile? Cannot register new server |
|||||||||||||||||||||||