i have to load some images in a table from png files.
I found something like this:
SET image = (SELECT BulkColumn FROM OPENROWSET (BULK 'c:\images\0001.png' , SINGLE_BLOB) AS x)
My trouble is that the file name must changes with the id field, for example id 0001 has 'c:\images\0001.png', id 0002 has 'c:\images\0002.png'.
How can I change the bulk filename with a field of "people" table?
You could use xp_cmdshell to get a list of files from the directory and then execute dynamic SQL to load each one by name.
You could also set up a DTS or SSIS package with variables to represent filenames and program it to load your data.
If it's not practically useful, then it's practically useless.