problem scripting a BULK INSERT
Hi,
I'm trying to script the creation of a database. I've used Visual Studio to generate the scripts to create tables and views. I now want to script populating the data. Some of the tables contain a lot of data so I was going to use BULK INSERT but when the script runs, it cannot find the location of the data and format files.
Is there a way of getting around this? I can't use a fixed location.
thanks
Jason
[445 byte] By [
Smallmaj] at [2007-12-29]
Do you know if the client you will be running the scripts from is remote or local? If it's a remote client, than you would probably be better off loading the data using BCP. Assuming that you will use either SQLCMD or OSQL to run the scripts, it would be really easy to launch BCP using the !! syntax. In this case the file names that you give to BCP do not have to be specified using absolute file paths (as you normally do when invoking BULK INSERT).