x

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

ETHMAN5 gravatar image

ETHMAN5
482 44 46 48

(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][3]

[3]: /upfiles/netconfig.PNG
more ▼

answered Nov 29, 2010 at 12:55 PM

WilliamD gravatar image

WilliamD
25.9k 17 19 41

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 ♦
+1 - 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

Scot Hauder gravatar image

Scot Hauder
6k 13 15 18

(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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x75
x46
x42

asked: Nov 29, 2010 at 12:42 PM

Seen: 1901 times

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