Solved

Remote SQL Azure Database BCP Connection Problem

Posted on 2011-02-11
2
1,445 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
ID: 34878181
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
ID: 34902083
Fantastic answer Lowfatspread! Thank you so very much!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Correct Thousand and decimal separator in sql server 2008 3 25
Webservices in T-SQL 3 30
SQL Server 2012 r2 - Varible Table 3 23
convert null in sql server 12 31
Companies keep a much closer eye on costs today, so changing to new Technology – Microsoft Office 365 is the smartest move to take.
Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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