I am getting this error while importing data from a csv file to SQL azure table. I am new to this technology. So I am trying it out with some small no of records. I have very few records in my csv file and my Azure database table is empty right now.
This is the structure of the table in SQL Azure:
Create Table BCP
(
Id int identity(1,1)
Value int,
Name nvarchar(50),
Constraint [pk_bcp] primMary key clustered([id] asc)
) on [primary]
records I am trying to insert are as follows
100, abc
200, bcd
300, cdf
400, efg
500, fgh
600, ghi
700, hij
800, ijk
900, jkl
I am trying to achieve through command prompt. the command I am using is
C:\Users\Administrator>BCP TestTask.dbo.BCP In C:\Users\Administrator\Desktop\Example\BCP.csv
-S tcp:<servername>.database.windows.net
-U 12345admin@<servername>.database.windows.net
-P Welc@m#123 -E -h 'TABLOCK' -n -k
If someone knows the correct solution of it please help me out I had already tried many solution but that didn't work for me.
Your help will be appreciated.
I also encountered the same the issue,in my case the table doesn't have the clustered index, in SQL Azure you cann't insert the data into any table unless you have clustered index on that table.