Table name : sample
Table structure :
ID int NAME varchar(30) IPADDRESS varbinary(16)
mysql query :
load data concurrent local infile 'C:\test.txt' into table sample fields terminated by ',' LINES TERMINATED BY '\r\n' (ID,NAME,@var3) set IPADDRESS = inet_pton(@var3)
SQL Server equivalent query :
using bcp will be appreciated.. Thanks in advance..
Here is an article which you will find useful:
It was the second result from Google when searching for "bcp load file"
You might be able to do your import in two steps. Load the rows from the file in to a temp table then apply a function to convert the IP strings to the binary format.
Have a look at this question on SO: Datatype for storing ip address in SQL Server