July 6, 2012 at 5:00 am
Hi All,
i have an SSIS package that loops round a recordset, it takes a file name and path and copies it into other directories, updates a DB entry and a few other things.
this is working great.
however, there is one more thing that i have to do to the file within the package.
this is to update a custom propery of the file.
the file has a custom property of 'DateApproved' and i need to set this to todays date.
i have looked at the filesystemtask and the attributes you can update there are minimal.
does anyone have any advice/ideas on how to do this?
thanks
Ian.
July 6, 2012 at 5:06 am
i.campbell (7/6/2012)
Hi All,i have an SSIS package that loops round a recordset, it takes a file name and path and copies it into other directories, updates a DB entry and a few other things.
this is working great.
however, there is one more thing that i have to do to the file within the package.
this is to update a custom propery of the file.
the file has a custom property of 'DateApproved' and i need to set this to todays date.
i have looked at the filesystemtask and the attributes you can update there are minimal.
does anyone have any advice/ideas on how to do this?
thanks
Ian.
I think you'll have to use a script task to do this - I've done similar in the past (though not with custom properties, I'll admit).
July 6, 2012 at 7:44 am
Ah ok... do you have any script code i could look at to fathom how to do this?
thanks
Ian.
July 6, 2012 at 8:13 am
i.campbell (7/6/2012)
Ah ok... do you have any script code i could look at to fathom how to do this?thanks
Ian.
It was in a previous role and I don't still have the code.
But you can do stuff like this in your (C#) Script Task:
string path = @"c:\temp\Test.txt";
File.SetAttributes(path, FileAttributes.Normal);
Good look.
July 6, 2012 at 8:48 am
this was an interesting article on setting custom file attributes;
http://blog.rodhowarth.com/2008/06/how-to-set-custom-attributes-file.html
i found it interesting that you can set attributes on non- MS Office files, and the attribute stays as long as the file is on an NTFS system; read the comments in the blog.
you need the DSOFile.dll to do this, I guess.
Lowell
July 6, 2012 at 9:24 am
Thanks, i will give this a good read next week, but it sounds like just the job.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy