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
 SQL Server Development (2000)
 BULK INSERT - Transact SQL

Author  Topic 

Amethystium
Aged Yak Warrior

701 Posts

Posted - 2003-07-11 : 10:02:34
Hi,


BULK INSERT MIGRATION_CITNEW.DBO.BENEFITSTATMENT
FROM '\\EPS-S136\USERDIRS\AMETHYSTIUM\AVALON\BENEFITSTATMENT.csv'
WITH (
FIELDTERMINATOR = ','
)
GO



If the .csv file is removed to a different folder, the BULK INSERT statment will fail. Therefore, is there a way to solve this problem? i.e. giving a relative path rather than specifying the absolute path of the file within Transact SQL?

Thank in advance.



---------------
Shadow to Light

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-11 : 10:24:30
What do you mean by solve?

Handle the fact that the file is not there?

Go searching for it?

Use @@ERROR to trap the error?



Brett

8-)
Go to Top of Page

Amethystium
Aged Yak Warrior

701 Posts

Posted - 2003-07-11 : 10:38:56
Oh no...

I was wondering if it is possible to give it a relative path rather than hard coding it. Obviously if I move the file from the AVALON folder, the BULK INSERT statement will fail.


---------------
Shadow to Light
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-11 : 10:43:32
quote:

a relative path rather than hard coding it.



What's that?

YOu could pass in the path and file name as a parameter to a sproc and build dynamic sql to execute it?

But I've never heard what a relative path is.



Brett

8-)
Go to Top of Page
   

- Advertisement -