• You may use dynamic query and xp_cmdshell, smth like this:

    --be sure you have permissions from DBA, and configured server:

    /*

    exec sp_configure 'show advanced options', 1

    reconfigure with override

    exec sp_configure 'xp_cmdshell', 1

    reconfigure with override

    */

    declare @sql nvarchar(max);

    declare @files table (fname sysname);

    insert @files values ('1'),('2'),('3');

    set @sql = (

    select replace('exec sys.xp_cmdshell ''copy \\server1\Images\<Item_number>.bmp c:\temp'';','<Item_number>',fname)

    from @files for xml path('')

    )

    print(@sql);

    --exec(@sql);


    I am really sorry for my poor gramma. And I hope that value of my answers will outweigh the harm for your eyes.
    Blog: http://somewheresomehow.ru[/url]
    Twitter: @SomewereSomehow