I have db table Person which has columns like
Id | Name | Dob | ....
now I added one more column CompanyLogo of type varbinary(MAX)
which will is now null. Since I have more than 1000 records in Person table I want to insert on the fly using sql statement some default image for CompanyLogo. Later trough ui this image wil be changed for each person, but that's not the scope of this question.
I tried with code
@"begin
UPDATE Person SET [CompanyLogo] = (SELECT
CompanyLogo.* from Openrowset(Bulk
'd:\test.png', Single_Blob) TestCompanyLogo)
end
"
but I'm getting following exception
System.Data.SqlClient.SqlException: Column name or number of supplied values does not match table definition