2012年3月11日星期日

BCP help, or alternative


I need some help on this.
I currently use BCP to transfer my tab delimted text file into my SQL
2000 database. I use a format file. This has been working well, but I am
currently receiving an error message about some data. I am not concerned
about that at this time.
I'd prefer to get some feedback from you all. What other options do I
have besides BCP? The data file I have has 108 columns, and about 8000
rows so it's alot of data. I only NEED to import about 40 of those
columns. I know BCP allows this, hence why I ahve been using it.
I have a shared SQL server and do not believe I can create a DTS on it.
What other options do I have? Currently a PERL files runs all my
commands for BCP, so maybe I can use something else in the PERL file,
besides BCP.
I also have my own server, so there are no limitations there. Just with
the shared SQL box.
*** Sent via Developersdex http://www.examnotes.net ***C# is great for whipping up a quick parsing tool that will process the file
and output something a little more palatable to SQL Server. Ideally, you'd
have an output file with only the data you need, and one that can be
imported into the database using something as simple as BULK INSERT.
"Joey Martin" <joey@.kytechs.com> wrote in message
news:O2TfqxGRGHA.2532@.TK2MSFTNGP10.phx.gbl...
>
> I need some help on this.
> I currently use BCP to transfer my tab delimted text file into my SQL
> 2000 database. I use a format file. This has been working well, but I am
> currently receiving an error message about some data. I am not concerned
> about that at this time.
> I'd prefer to get some feedback from you all. What other options do I
> have besides BCP? The data file I have has 108 columns, and about 8000
> rows so it's alot of data. I only NEED to import about 40 of those
> columns. I know BCP allows this, hence why I ahve been using it.
> I have a shared SQL server and do not believe I can create a DTS on it.
> What other options do I have? Currently a PERL files runs all my
> commands for BCP, so maybe I can use something else in the PERL file,
> besides BCP.
> I also have my own server, so there are no limitations there. Just with
> the shared SQL box.
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Yeah BULK INSERT is supposed to be faster than bcp too. It has similar
arguments and can be run from a SQL script instead of a batch file. You can
even use your format file with it ( I think!).
I'm a big fan of both bcp and BULK INSERT, not so much DTS.
Damien
"Aaron Bertrand [SQL Server MVP]" wrote:

> C# is great for whipping up a quick parsing tool that will process the fil
e
> and output something a little more palatable to SQL Server. Ideally, you'
d
> have an output file with only the data you need, and one that can be
> imported into the database using something as simple as BULK INSERT.
>
>
> "Joey Martin" <joey@.kytechs.com> wrote in message
> news:O2TfqxGRGHA.2532@.TK2MSFTNGP10.phx.gbl...
>
>|||Aaron Bertrand [SQL Server MVP] (ten.xoc@.dnartreb.noraa) writes:
> C# is great for whipping up a quick parsing tool that will process the
> file and output something a little more palatable to SQL Server.
> Ideally, you'd have an output file with only the data you need, and one
> that can be imported into the database using something as simple as BULK
> INSERT.
Tsssk! Joey is already using Perl, and what better tool is there to
read and parse a file than Perl?
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|||> Tsssk! Joey is already using Perl, and what better tool is there to
> read and parse a file than Perl?
Perl, C#, whatever. My point was that *any* application language parsing,
trimming and re-formatting the file is going to do more for you in the long
run than messing with the BCP format file and leaving the input files
untouched. My experience is with C#, not with Perl.

没有评论:

发表评论