Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL 2005 reading file attributes

Author  Topic 

fahdmalik
Starting Member

6 Posts

Posted - 2007-12-12 : 17:47:29
In SQL 2005, is it possible to read the date modified of a file which is located on the hard drive of the server? Is there a procedure/function that would allow you to do so?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-12-12 : 17:49:51
You can do this through a DOS command that can be run from xp_cmdshell.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

fahdmalik
Starting Member

6 Posts

Posted - 2007-12-12 : 17:52:16
Yes it can be done using that, but DBAs normally don't allow that command. Without using CLR Integration/SSIS, is it possible?
Go to Top of Page

Haywood
Posting Yak Master

221 Posts

Posted - 2007-12-12 : 18:05:35
You can use DMO (if enabled) or SMO as well.
Go to Top of Page

fahdmalik
Starting Member

6 Posts

Posted - 2007-12-12 : 18:17:34
True. But we want to work in the database environment. Any idea if this can be achieved? If there is some undocumented procedure or something?
Go to Top of Page

Haywood
Posting Yak Master

221 Posts

Posted - 2007-12-12 : 18:33:15
DMO & SMO are both 'within' the database enviroment...
Go to Top of Page

fahdmalik
Starting Member

6 Posts

Posted - 2007-12-12 : 19:01:02
Aren't these COM objects used in .Net? I can't call them within a stored procedure, right?
Go to Top of Page
   

- Advertisement -