Using SQL Server 2014
I have created a test database for testing where I wish to store a images for various departments. When running a query to insert the image I get the Invalid column name error.
Msg 207, Level 16, State 1, Line 6
Invalid column name 'AgencyID'.
Database Name: ImageTest
Table Name: Agency
INSERT INTO Agency ([ImageName], [Image])
SELECT 'Glencoe', *
FROM OPENROWSET(BULK N'D:\TestImage\Glencoe.jpg
', SINGLE_BLOB) image
where AgencyID = 1;
The way I want to insert the image is based on the AgencyID field. So I can insert multiple images into the table based on the AgencyID Value. That way I can pull them into a Crystal Report based on the AgencyID Field when the report is run.
I have attached the script to build the database and tables.