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.
| Author |
Topic |
|
killtacularmania
Starting Member
22 Posts |
Posted - 2010-04-27 : 13:54:25
|
| I have a batch file that downloads a folder from an sftp site. Is it possible to use SQL to rename the most recent modified file?NAME DATE MODIFIEDhello042010.zip 4/20/2010hello042110.zip 4/21/2010hello042210.zip 4/22/2010 -------This is the file I would want to rename.Thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-27 : 13:58:52
|
yupSELECT NAME, DATEMODIFIEDFROM (SELECT ROW_NUMBER() OVER (PARTITION BY Name ORDER BY DateModified DESC) AS Seq,*FROM Table)tWHERE Seq=1 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|