Showing posts with label bcp. Show all posts
Showing posts with label bcp. Show all posts

Friday, March 9, 2012

Maximum INput that a BCP utility can take

Can any one help me out form this... I just want to know the maximum input a bcp utility can take.... its a direct insert from one table to another but contains millions of data
...How many millions? The last largest bulk insert I've done (it's running daily, and no, I don't do TRUNCATE TABLE before it ;)) varied between 800 million and 1.6 billion. The width was around 4K characters, and the job execution varied between 3 and 5 hours. I suspect you'll run into OS limitations before you start having problems with bulk load.

Saturday, February 25, 2012

MAXERRORS in BCP Does'nt work

Hi,
I'm trying to use MAXERRORS option (-m switch) to force loading to continue
even though errors occur, but the load stop at the first error occur, all
batch is commited and no error is logged in error file (-e hint)
here is the commande I'm using :
exec master.dbo.xp_cmdshell 'bcp "DBName.dbo.TableName" in
"Path\FileName.tab" -m1000 -e"Path\ErrorFile" -T -E -n -q -S"ServerName"'
Is there any people successfuly use MAXERRORS option ?
Thanks for your helpMark (sauvemark@.yahoo.com) writes:
> I'm trying to use MAXERRORS option (-m switch) to force loading to
> continue even though errors occur, but the load stop at the first error
> occur, all batch is commited and no error is logged in error file (-e
> hint)
> here is the commande I'm using :
> exec master.dbo.xp_cmdshell 'bcp "DBName.dbo.TableName" in
> "Path\FileName.tab" -m1000 -e"Path\ErrorFile" -T -E -n -q -S"ServerName"'
> Is there any people successfuly use MAXERRORS option ?
Yes, I've used it successfully. But it depends on what sort of error you
get. What is the exact output you get?
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|||> Yes, I've used it successfully
Glad to here this, I thought this a bug

> What is the exact output you get?
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY
KEY constraint
I apreciate your help
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns97E969C5660BYazorman@.127.0.0.1...
> Mark (sauvemark@.yahoo.com) writes:
"Path\FileName.tab" -m1000 -e"Path\ErrorFile" -T -E -n -q -S"ServerName"'
> Yes, I've used it successfully. But it depends on what sort of error you
> get. What is the exact output you get?
>
> --
> 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|||Mark (sauvemark@.yahoo.com) writes:
> Glad to here this, I thought this a bug
>
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of
> PRIMARY KEY constraint
OK, so the errors that MAXERRORS control are conversion errors within the
file. That is, you are supposed to provide a decimal value, but the
valiue BCP finds is not decimal, so it cannot convert.
This is a pure SQL error, and for a PK violation the standard rule
applies: the entire statement is rolled back. That is, the entire BCP.
Unless you set a batch size. Then only the batch(es) with the violating
key are dropped. (At least I believe that BCP will continue, but I
have not tested, and now the hour is late.)
Setting a batchsize of 1, would give you all rows that does not violate
the PK, but that is likely to be effecient. Better is probably to use
a staging table, and then clean up the data in SQL Server.
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

max_errors in bcp

Can any one help on this ?
I have set the -m parameter for bcp for importing but its
not working.
C:\>bcp TestDB.dbo.TestTable in E:\DataFile.txt -w -m1000
-eE:\Error.txt -SServerName -Usa -P
ThanksWhat exactly is the problem? Couyld you be more specific?
Tengiz Khartishvili
SQL Server Storage Engine
This posting is provided "as is" with no warranties and confers no rights.
"Manoj" <manoj_raheja@.hotmail.com> wrote in message
news:11a5401c3f544$0570b6c0$a401280a@.phx
.gbl...
> Can any one help on this ?
> I have set the -m parameter for bcp for importing but its
> not working.
> C:\>bcp TestDB.dbo.TestTable in E:\DataFile.txt -w -m1000
> -eE:\Error.txt -SServerName -Usa -P
>
> Thanks
>