BCP Error..need Help

When using below BCP on drive D:

 bcp "TESTDB.dbo.TESTTABLE" out "[TESTTB].[dbo].[TESTTABLE].dat" -q -c -CRAW 
 -t "<EOFD>" -r "<EORD>" -U<Username> -P<Password> -S<ServerName>

 SQLState = 08001, NativeError = 17
 Error = [Microsoft][ODBC SQL Server Driver]
         [Shared Memory]SQL Server does not exist or access denied.
 SQLState = 01000, NativeError = 2
 Warning = [Microsoft][ODBC SQL Server Driver]
           [Shared Memory]ConnectionOpen (Connect()).

Help me out..

more ▼

asked Nov 29, 2010 at 12:42 PM in Default

avatar image

482 44 46 51

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

You are trying to connect to a server using shared memory - is this protocol active on the machine? Is the username and password valid? You can test these by trying to open a connection to the machine in SSMS and specifying the username/password and protocol. This will show if the protocol is working or not. You can then also check that the username and password is correct:

alt text

alt text

It may be also worth you checking the protocol is really set to "enabled". To check network connections for the sql server go to Start -> SQL Server 2k? -> Configuration Tools -> SQL Server Configuration Manager - You can then see which protocols are active for the instance:

alt text

more ▼

answered Nov 29, 2010 at 12:55 PM

avatar image

26.2k 18 37 48

Great answer. In fact, too good. You don't leave any crumbs.

Nov 29, 2010 at 06:46 PM Grant Fritchey ♦♦

I think I said something similar to @WilliamD last night, bless 'im...

Nov 30, 2010 at 12:10 AM ThomasRushton ♦♦
  • for a great answer made awesome with images and colouring-in and highlighting. Epic!!!

Nov 30, 2010 at 01:10 AM Fatherjack ♦♦

Yeah - had a crayola moment yesterday evening. pics make it much easier to explain sometimes - highlighting just looks cool! ;)

Nov 30, 2010 at 01:19 AM WilliamD

Just noticed you have cracked 6k karma too. Nice one, thanks for being around and helping :D

Nov 30, 2010 at 02:47 AM Fatherjack ♦♦
(comments are locked)
10|1200 characters needed characters left

Add the sqllogin as a database user in TESTDB and give it SELECT permissions. You will get this error if the user has a login but no access to the db. Also make sure your server is set up for mixed mode (SQL Server and Windows Authentication). If you are using sqlexpress or are in a clustered environment be sure to add the appropriate server\\instance_name

more ▼

answered Nov 29, 2010 at 08:28 PM

avatar image

Scot Hauder
6.5k 13 16 22

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 29, 2010 at 12:42 PM

Seen: 2246 times

Last Updated: Nov 29, 2010 at 01:11 PM

Copyright 2018 Redgate Software. Privacy Policy