BCP utility uploads 0 rows to SQL Server Azure


bcp azure_db.dbo.db_table in calendar_dates.txt -f ../../../scripts/format_files/calendar_dates.fmt -f 2 /s tcp:azure_server /u username@servername /p password


when issue command through powershell prompt, following response:

starting copy..
network packet size 4096
clock 546 ms
0 rows copied.

when @ table in azure, there no rows reported.  i tried removing entries in text file leaving first 2 lines, no avail.

if input file name wrong or format file name wrong, or first  line indicating sql server version in format file wrong, appropriate error message returned bcp.  with correct parameters, or seems, no error reported, yet nothing happens.  anyone seen this?

just figured out problem way bcp interpreting line terminating characters.  notepad says routes.txt, call "bad-file" has no line terminating characters , looks this:

route_id,route_short_name,route_long_name,route_desc,route_type,route_url 1-184,1,,,3, 2-184,2,,,3,

4-184,4,,,3,  5-184,5,,,3, 6-184,6,,,3, 7-184,7,,,3, 8-184,8,,,3, 9-184,9,,,3,

notepad++, however, see this:

route_id,route_short_name,route_long_name,route_desc,route_type,route_url
1-184,1,,,3,
2-184,2,,,3,
4-184,4,,,3,
5-184,5,,,3,

note: editor on site recognizes line terminators.  i had deliberately remove line terminators.

so, using notepad++, create new blank file, routes1.txt, call "good-file" selected text bad file using ctrl + , copied content clipboard new file using ctrl+v.

opened new file in notepad , looks formed.  if make copy of bad-file, bcp runs same problem notepad.

seems bcp using similar code notepad parse files....



Microsoft Azure  >  Azure SQL Database



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........