var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Import db from dump with bcp
I am trying to import a database from a dump file.
The dump file is from a sql server db.
I have created the db on another server and want to import the data from the
I use the bcp like this :
bcp nnfdb.sa.users in x -Usa -P
nnfdb is the name of the database
users is the name of a table
x is the name of the dump file.
But I get this error :
SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
also I am sure if I have to run the bcp for each table or if I can import
all tables in one bcp run.
You may need to specify the server in the bcp-command. As far as I know bcp works on one table for each run, so you may need to run bcp a few times.
Sometimes it's easier and more convenient to just copy the entire database from one location to another (instead of coping each table one by one).
What's the format of the dump file?
I have also tryed this :
bcp nnfdb.sa.users in x -Usa -P -Sdk1052
dk1052 is the name of my local machine.
But I get the same error.
How could I copy the hole db in one step ?
I now found out that if I use dbo instead of sa I dont get the same error.
So I use :
bcp nnfdb.dbo.users in x -Usa -P -Sdk1052
But it lookes like it is trying to insert everything into the users table.
The dump file is a 20G big file containing the hole db.
I havent made the dump file myself so I don't now how it was created.
The easiest way to copy or move a database, in my opinion, is to detach the database, copy or move it to the new location, then attach it.
If the dump file does _not_ have an mdf extention I would suspect it's the result of a backup operation. You'll need to restore the file if that is the case. You can backup/restore from the EM, right click 'Databases', choose 'All tasks.. restore'
(probably restore from a device).
I am now trying to restore the db with the EM.
But I am getting an error, see the atached file 'error1.jpg'
I have placed the db and the dump file on a drive with 80 GB
I finally got it to work, the database was created in the wrong drive.