Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
nkm
Starting Member
3 Posts |
Posted - 2011-01-19 : 14:23:02
|
| Need to insert byte array value in to a column using bcp bulk copy.Any way? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
nkm
Starting Member
3 Posts |
Posted - 2011-01-19 : 15:55:28
|
| Its a array of bytes (IPV6 address in bytes)By preparedstatement i can insert the value using setBytes function.But i needed this value to be inserted along with another 10 different columns to a table. |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2011-01-19 : 17:23:18
|
| We know nothing about your data (file?) or table structure. Are you asking how to use BCP to import some data or do you not know how to insert a row into a table from some other data source? Are you not trying to store the byte array as a byte array, but rather, convert it to some kind of string or and numeric value for each octet or something? Help us help you.This link might help you articulate what you trying to do.http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
nkm
Starting Member
3 Posts |
Posted - 2011-01-20 : 05:04:15
|
| Table name : sampleTable 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.. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|