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 2008 Forums
 SSIS and Import/Export (2008)
 bcp utility not working correctly

Author  Topic 

MzzzShay
Starting Member

4 Posts

Posted - 2011-09-13 : 11:51:20
I have a txt file that I am trying to import into SSME using the bcp command in the command prompt window.

My command is:
bcp tempdb.dbo.Sales in
'C:\desktop\Sales.txt' -T -c

When I execute it the code text file opens in notepad and does not import SSME.

Please help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-13 : 12:53:45
Put it all on one line and remove the single quotes.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

MzzzShay
Starting Member

4 Posts

Posted - 2011-09-13 : 18:39:02
I tried that and now I am getting this error message.
SQLState = $0002, NativeError = 208
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server] Invalid obeject name 'DimProducts'.
Go to Top of Page

MzzzShay
Starting Member

4 Posts

Posted - 2011-09-13 : 18:40:13
P.S. I was at work when I put my first post and couldn't remember the name of the table. It is DimProducts not Sales.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-13 : 18:56:21
It seems the table doesn't exist yet. Bcp requires that the object exists first.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

MzzzShay
Starting Member

4 Posts

Posted - 2011-09-13 : 19:28:19
I did create the tables. I figured it out though. I have both sql server 2008 and sql server 2008 express and I was not connecting to the express version that my table exists on. Thank you for your help though.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-13 : 19:31:37


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -