Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Can a BULK INSERT be performed from one server box to another one?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-01-23 : 07:12:25
Lucio Gayosso writes "Hello!

I have the following configuration for a Client/Server app:

Server A contains a server program that reads a text file and triggers a BULK INSERT command
Server B holds the SQL Server Database

When I try this basic statement

bulk insert DBNAME.TABLENAME from FILENAMEWITHPATH WITH
(
FIELDTERMINATOR = '~'
)

I get an error.

If just one server contains both the server program and database everything works OK.

I see that the syntax for the BULK INSERT states:

BULK INSERT [ [ 'database_name'.] [ 'owner' ].] { 'table_name' FROM 'data_file' }


So I don't see how I can specify the server or ODBC Datasource to use.

Any suggestion will be greatly appreciated

Regards,

Lucio Gayosso"

nr
SQLTeam MVY

12543 Posts

Posted - 2004-01-23 : 08:36:52
You will need to connect to the server to run the bulk insert.
You connect using a linked server then run the bulk insert using sp_executesql or better call an SP to do it.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -