bcp connection error

  • I have sql server express installed on my local machine and I am trying to send data from a table out to a text file using bcp from cmd using this command:

    bcp dbMeals.dbo.tblFood OUT e:\Innovaya\food.txt -c -S -T

    But I am getting this error message:

    SQLState = 08001, NativeError = 10061

    Error = [Microsoft][SQL Server Native Client 10.0]TCP Provider: No connection co

    uld be made because the target machine actively refused it.

    SQLState = 08001, NativeError = 10061

    Error = [Microsoft][SQL Server Native Client 10.0]A network-related or instance-

    specific error has occurred while establishing a connection to SQL Server. Serve

    r is not found or not accessible. Check if instance name is correct and if SQL S

    erver is configured to allow remote connections. For more information see SQL Se

    rver Books Online.

    SQLState = S1T00, NativeError = 0

    Error = [Microsoft][SQL Server Native Client 10.0]Login timeout expired

    I can connect the the instance and the browser is running. Any ideas?

    Thanks!

  • SQL Express usually installs as an instance name, and not a default instance.

    your BCP is assuming a default instance, i'd bet you have a named instance instead.

    check your servername\instancename, but i bet it's something like this instead:

    bcp dbMeals.dbo.tblFood OUT e:\Innovaya\food.txt -c -S .\SQLEXPRESS -T

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks Lowell! That was it, I just need to add my server name/instance name.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply