Solved

Remote SQL Azure Database BCP Connection Problem

Posted on 2011-02-11
2
1,405 Views
Last Modified: 2014-11-12
Hi, I'm trying to use BCP with my SQL Azure database. The following bcp call to get a format file is resulting in as error:

bcp databasename.dbo.tablename format nul -x -f c:/localstoragepath/FormatFileName.xml -n -S myservername.database.windows.net -Umyusername -Pmypassword -T

The error returned is:
Server name cannot be determined. It must appear as the first segment of the server's dns name (servername.database.windows.net). Some libraries do not send the server name, in which case the server name must be included as part of the user name (username@servername). SQLState=37000, NativeError = 40531

Can anyone point out the problem with my bcp command parameters? Thanks!
0
Comment
Question by:Drevo
2 Comments
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 500 total points
Comment Utility
have you tried

bcp databasename.dbo.tablename format nul -x -f c:/localstoragepath/FormatFileName.xml -n -S myservername.database.windows.net -Umyusername@myservername -Pmypassword


as the error suggests you may need to include the server name on the userid...

also i don't think you should also have the -T flag ... its not a trusted connection ?

anyway -U -P should be mutually exclusive with -T  i believe it would have been trying a trusted connect
rather than you userid and password....
0
 

Author Comment

by:Drevo
Comment Utility
Fantastic answer Lowfatspread! Thank you so very much!
0

Featured Post

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now