2012年2月23日星期四

BCP and SQL Server 2K

To all,

I've got 3 questions on BCP and SQL Server 2K
1) actually is it BCP's functionalities == DTS under Enterprise Manager
?
2) I've tried to use bcp under isql (ie. the command prompt version in
accessing the SQL server) but it just return an error like this 'Could
not find stored procedure 'bcp'.'; I wonder should I run BCP in this
mode or not ?
3) assume I could bcp a table's data to a file; then how can I pump it
to another table on another database ?

Thanks!

>From Jason (Kusanagihk)<kusanagihk@.gmail.com> wrote in message
news:1115862396.057790.23710@.o13g2000cwo.googlegro ups.com...
> To all,
> I've got 3 questions on BCP and SQL Server 2K
> 1) actually is it BCP's functionalities == DTS under Enterprise Manager
> ?
> 2) I've tried to use bcp under isql (ie. the command prompt version in
> accessing the SQL server) but it just return an error like this 'Could
> not find stored procedure 'bcp'.'; I wonder should I run BCP in this
> mode or not ?

bcp is a stand alone program. I.e. you run it at the command prompt
directly, not from within ISQL.

> 3) assume I could bcp a table's data to a file; then how can I pump it
> to another table on another database ?

DTS is better for this.

> Thanks!
> >From Jason (Kusanagihk)|||For Q3.. Assuming that your servers can see each other, consider
"SELECT INTO" instead of BCP

Greg D. Moore (Strider) wrote:
> <kusanagihk@.gmail.com> wrote in message
> news:1115862396.057790.23710@.o13g2000cwo.googlegro ups.com...
> > To all,
> > I've got 3 questions on BCP and SQL Server 2K
> > 1) actually is it BCP's functionalities == DTS under Enterprise
Manager
> > ?
> > 2) I've tried to use bcp under isql (ie. the command prompt version
in
> > accessing the SQL server) but it just return an error like this
'Could
> > not find stored procedure 'bcp'.'; I wonder should I run BCP in
this
> > mode or not ?
> bcp is a stand alone program. I.e. you run it at the command prompt
> directly, not from within ISQL.
> > 3) assume I could bcp a table's data to a file; then how can I pump
it
> > to another table on another database ?
> DTS is better for this.
> > Thanks!
> > >From Jason (Kusanagihk)|||To all,

Yes, you are right, I could simply use select into instead... but the
matter is I want to copy the data from SQL server to DB2 (actually the
table schema is the same; just don't want to write numerous insert into
sql statements for the same contents)

Is it still possible to use DTS to perform cross DB server data copy /
transformation ??

>From Jason (Kusanagihk)|||(kusanagihk@.gmail.com) writes:
> Yes, you are right, I could simply use select into instead... but the
> matter is I want to copy the data from SQL server to DB2 (actually the
> table schema is the same; just don't want to write numerous insert into
> sql statements for the same contents)
> Is it still possible to use DTS to perform cross DB server data copy /
> transformation ??

I would be very surprised if that is not possible, but I have never used
DTS (and even less DB2), so I can't say for sure.

Using BCP on the SQL Server side, and similar tool on the DB2 side, also
sounds like a workable idea, particularly if the tables have identical
schema. It does require, though, that the DB2 will interpret the output
file that BCP generates correctly. I would assume any such issues to be
built into DTS.

For information on DTS, try http://www.sqldts.com and
microsoft.public.sqlserver.xml.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

没有评论:

发表评论