2012年3月11日星期日

Bcp import - how? - question is still open

Thanx, that works! But the question is still open, how to do it using bcp
Thanx
Adam
Adam Boczek
adam.boczek@.cs-consulting.de
"Hari" <hari_prasad_k@.hotmail.com> schrieb im Newsbeitrag
news:uL0jbLHSEHA.380@.tk2msftngp13.phx.gbl...
> Hi,
> Use BULK Insert.
> 1. I have saved the contents as ccc.txt in drive.
> 2. Created a table with below script :-
> create table zz(id uniqueidentifier,name varchar(30),calories int)
> 3. Executed the below in query analyzer
> BULK INSERT master.dbo.zz
> FROM 'c:\ccc.txt'
> WITH
> (
> FIELDTERMINATOR = ','
> )
> 4. select * from zz
> id name
calories
> -- -- --
--[vbcol=seagreen]
> --
> F5F781EF-4270-4D8C-B5E0-A968F45FF771 "Ananas frisch" 60
> CA0E96D8-9017-4DDD-BF29-B78D3DC8180D "Ananas Fruchtnektar" 70
> A1777D54-9303-4AF5-A721-250A39BA731C "Ananas Fruchtsaft" 60
> DACC2063-0985-41EB-9A33-B4D8A10F1C79 "Ananas getrocknet" 300
> 04E462EC-57B1-4882-A8DF-A1EFC1B9C4F3 "Ananas kandiert" 250
> (5 row(s) affected)
> Thanks
> Hari
> MCDBA
> "Adam Boczek" <adam.boczek@.NO_SPAM.cs-consulting.de> wrote in message
> news:1086160529.62750@.proxy.ham.cs-consulting.de...
find
> a
>
This seems to work for me
C:\>bcp tempdb.dbo.zz in c:\Document.txt -t, -T -S(local) -c -F2
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Adam Boczek" <adam.boczek@.NO_SPAM.cs-consulting.de> wrote in message
news:1086163109.696219@.proxy.ham.cs-consulting.de...
> Thanx, that works! But the question is still open, how to do it using bcp
[vbcol=seagreen]
> Thanx
> Adam
> --
> ----
> Adam Boczek
> adam.boczek@.cs-consulting.de
> ----
> "Hari" <hari_prasad_k@.hotmail.com> schrieb im Newsbeitrag
> news:uL0jbLHSEHA.380@.tk2msftngp13.phx.gbl...
> calories
> -- -- --
> --
I've
> find
>
|||Wow, that's it! "-c" and also "-C" for german special signs.
Thanx,
Adam
Adam Boczek
adam.boczek@.cs-consulting.de
"Allan Mitchell" <allan@.no-spam.sqldts.com> schrieb im Newsbeitrag
news:ecRIrpHSEHA.2876@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> This seems to work for me
> C:\>bcp tempdb.dbo.zz in c:\Document.txt -t, -T -S(local) -c -F2
>
> --
> --
> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
> www.SQLDTS.com - The site for all your DTS needs.
> I support PASS - the definitive, global community
> for SQL Server professionals - http://www.sqlpass.org
>
> "Adam Boczek" <adam.boczek@.NO_SPAM.cs-consulting.de> wrote in message
> news:1086163109.696219@.proxy.ham.cs-consulting.de...
bcp[vbcol=seagreen]
>
> -- -- --
300[vbcol=seagreen]
250
> I've
>
|||ich hatte keine spezielle Deutsche Anzeichen :-)
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Adam Boczek" <adam.boczek@.NO_SPAM.cs-consulting.de> wrote in message
news:1086167420.32079@.proxy.ham.cs-consulting.de...[vbcol=seagreen]
> Wow, that's it! "-c" and also "-C" for german special signs.
> Thanx,
> Adam
> --
> ----
> Adam Boczek
> adam.boczek@.cs-consulting.de
> ----
> "Allan Mitchell" <allan@.no-spam.sqldts.com> schrieb im Newsbeitrag
> news:ecRIrpHSEHA.2876@.TK2MSFTNGP09.phx.gbl...
> bcp
> -- -- --
60[vbcol=seagreen]
70[vbcol=seagreen]
60[vbcol=seagreen]
> 300
> 250
message[vbcol=seagreen]
of[vbcol=seagreen]
I
>

没有评论:

发表评论