显示标签为“linked”的博文。显示所有博文
显示标签为“linked”的博文。显示所有博文

2012年3月19日星期一

bcp in/out Oracle Linked Server

Is this possible?
Has anyone done this?
Any comments appreciated.Brett:

Sorry for being thick, but your question wasn't entirely clear to me:

Are you trying to use BCP on a linked Oracle server to dump a file from a command in SQL server? or

Are you trying to bulk load a table in Oracle with data in SQL (and vice-versa)?

Regards,

hmscott|||bcp out is possible:

you can create a procedure/function/view referencing the ora object and use queryout with your bcp using your procedure/function/view.

i haven't tried bcp'ing in into a linked server yet, but you can do a test yourself, right ? ;)|||Guys,

Thanks...

Sorry for not being clear...

I want to set up a generic (yes...dynamic sql against the catalog) to bcp out all tables (and gener format cards for fixed width).

That's built for sql server.

I want to establish a linked server, and point the sprocs at the linked server (Oracle, udb, whatever).

I was hoping to avoid queryout (that's why I gener the format cards)..

And yes, I can (and will test) the bcp back in...

I'm thinking I might have to gener view of the tables on the linked server..

Another question, how do you reference INFORMATION_SCHEMA of another database (in this case the linked server) from the context of the database you're in?

EDIT: Other responses http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=31183|||Originally posted by hmscott
Brett:

Sorry for being thick, but your question wasn't entirely clear to me:

Are you trying to use BCP on a linked Oracle server to dump a file from a command in SQL server? or

Are you trying to bulk load a table in Oracle with data in SQL (and vice-versa)?

Regards,

hmscott

fyi...It's SQLLoader in Oracle...

2012年2月23日星期四

BCP and Bulk Insert to Linked Servers

BCP and Bulk Insert to Linked Servers

Hi guys!

Heres my set up:
1) Im using Win2003 with MS SQL 2000
2) I have a linked server in SQL Server pointing to an MS Access DB.

Why MS Access? Gee, I dont know. The guy who owns it refused to update his
VB app and point it to SQL Server.

Anyway, I have 190,000 records in SQL Server that I wanted to dump and
insert it to MS Access.
I tried to use OPENQUERY but OLE DB provider choked and wont be able to
handle that much records. Sucks!
Moreover, DTS packages wont do the job. I tried it and it have the same
problem.
Now, I got one last option to go to. I EXPORTED SQL Server data to a text
file using BCP but my problem is how to IMPORT those data from the TEXT
file to my Linked Server that points to an MS Access.

This is what Im trying to do:

SQL Server Data --> Text file --> Linked Server (MS Access)

bcp LinkedServerName..MSAccess_TableName in Shares1_tmp.txt -c -T -t ',' -r
'\n'

SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not
exist or access denied.
SQLState = 01000, NativeError = 53
Warning = [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen
(Connect()).

Thank you and you guys have a nice day.

--
Message posted via http://www.sqlmonster.comErvs Sevilla via SQLMonster.com (forum@.SQLMonster.com) writes:
> Heres my set up:
> 1) Im using Win2003 with MS SQL 2000
> 2) I have a linked server in SQL Server pointing to an MS Access DB.
> Why MS Access? Gee, I dont know. The guy who owns it refused to update his
> VB app and point it to SQL Server.
> Anyway, I have 190,000 records in SQL Server that I wanted to dump and
> insert it to MS Access.
> I tried to use OPENQUERY but OLE DB provider choked and wont be able to
> handle that much records. Sucks!
> Moreover, DTS packages wont do the job. I tried it and it have the same
> problem.
> Now, I got one last option to go to. I EXPORTED SQL Server data to a text
> file using BCP but my problem is how to IMPORT those data from the TEXT
> file to my Linked Server that points to an MS Access.
> This is what Im trying to do:
> SQL Server Data --> Text file --> Linked Server (MS Access)

This sounds like a dead end to me. Bulk insert to linked server is not
supported, as I recall. And last time I looked at it, at least the
other server was another SQL Server.

I would suggest that you inquire in an Access newsgroup for how to import
that data into Access.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Yah thats what I thought too because those option fields from BCP dont have
something for Linked Servers.

Do you have any other suggestions to copy and insert those 190,000 records
to MS Access?

Thank you for the reply.
I appreciate it.

--
Message posted via http://www.sqlmonster.com|||Ervs Sevilla via SQLMonster.com (forum@.SQLMonster.com) writes:
> Do you have any other suggestions to copy and insert those 190,000 records
> to MS Access?

To repeat myself: ask in a newsgroup devoted to Access. Maybe there
are some people here who knows Access, but I am certainly not one of
them.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Ervs Sevilla via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:41fb40a4015744f5bee5bfdc03052973@.SQLMonster.c om...
> Yah thats what I thought too because those option fields from BCP dont
> have
> something for Linked Servers.
> Do you have any other suggestions to copy and insert those 190,000 records
> to MS Access?
> Thank you for the reply.
> I appreciate it.
> --
> Message posted via http://www.sqlmonster.com

One thing to try would be to experiment with the batch size option for a DTS
Transform Data task. The OLE DB provider might not like handling 190,000
rows in a single insert, but if you do it in batches of 10,000 rows (or
whatever), it might work. However, that's pure speculation, and as Erland
says, you'll probably get better information on importing into Access in an
Access group.

Simon|||Thank you guys...
Ill post my prob in MS Access forum.

By the way, I did tried to insert 1,000 records at a time but again OLEDB
Jet 4.0 for MS Access choked.

I forgot to mentioned that the destination table in Access have 106 columns
thats why using OPENQUERY choked as well. The table is flat like a pan cake.
Moreover, theres another table that only have 54 columns/fields and I was
able to insert a total of 230,000 records.

--
Message posted via http://www.sqlmonster.com