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.
| Author |
Topic |
|
arthiasha
Starting Member
40 Posts |
Posted - 2012-10-17 : 01:10:46
|
| Hi,I need to do bcp out of a table which does not hold any data. i need to take the columns alone and store it as a .fmt file.C:\inetpub\wwwroot\db>bcp temp out .\datafiles\temp.dat -S ACER-PC\SQLEXPRESS -U sa -P sai get the error asSQLState = S0002, NativeError = 208Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'temp'.I'm able to do bcp for all other tables in the db with the same path but not for this table.please help me |
|
|
Mike Jackson
Starting Member
37 Posts |
Posted - 2012-10-17 : 08:25:09
|
| you need the database as well as the tablebcp yourdatabase.temp out .\datafiles\temp.dat -S ACER-PC\SQLEXPRESS -U sa -P saMike |
 |
|
|
arthiasha
Starting Member
40 Posts |
Posted - 2012-10-18 : 03:11:39
|
| Thank u...and also how to import data from .csv file to a table in my db.I have created a fmt file for temp.How to import data using bcp command?C:\inetpub\wwwroot\db>bcp temp in C:\inetpub\wwwroot\db\employee.csv -w -d mydb -S ACER-PC\SQLEXPRESS -U sa -P sa -t,Starting copy...SQLState = S1000, NativeError = 0Error = [Microsoft][SQL Server Native Client 10.0]Unexpected EOF encountered inBCP data-file0 rows copied.Network packet size (bytes): 4096Clock Time (ms.) Total : 1I'm getting this errorPlease tell me what is wrong in my script? |
 |
|
|
|
|
|