Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6331521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:05:08+00:00 2026-05-24T18:05:08+00:00

I am building a TSQL query to parse through a FTP log from FileZilla.

  • 0

I am building a TSQL query to parse through a FTP log from FileZilla. I am trying to figure out if there is a way to get information from a line preceding the current one?

For example,
I have parsed out the Following procedure: “STOR file.exe”

With the FileZilla is doesn’t say if the STOR wass successful until the next line. So I want to check the next line and see if the STOR was successful or was unsuccessful?

Also people could try to STOR a files multiple times so I want to get the last version of its status.

Example Info from Log file:

   (000005) 4/10/2010 14:55:30 PM - ftp_login_name (IP Address)> STOR file.exe
   (000005) 4/10/2010 14:55:30 PM - ftp_login_name (IP Address)> 150 Opening data for transfer.
   (000005) 4/10/2010 14:55:30 PM - ftp_login_name (IP Address)> 226 Transfer OK

I want to add a column in my query that says that the STOR was successful or unsuccessful.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:05:09+00:00Added an answer on May 24, 2026 at 6:05 pm

    Assuming you have parsed these lines into actual columns, and you have SQL server 2005 or greater. You can use CROSS APPLY example query below (untested). I hope this helps.

    select o.*, prev.*
    from FTPLog o
    cross apply 
     (
       select top 1 *
       from FTPLog P where P.LogDate < O.LogDate 
       order by LogDate DESC
     ) prev
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Duplicate of : TSQL varchar string manipulation I'm building a dynamic SQL statement out
Building on from a previous query regarding Class::Struct vs Object::Accessor, I'd like to find
Building our Android app from Ant fails with this error: [apply] [apply] UNEXPECTED TOP-LEVEL
building a site which has content for each section. urls range from; /work/ /work/print/
Building an application with a database that has the ability to get big not
I am building up a dataset from SQL server - a stored procedure that
Building a string for post request in the following way, var itemsToAdd = sl.SelProds.ToList();
building upon the $.fn.serializeObject() function from this question , i'd like to be able
Building a multi-language application in Java. Getting an error when inserting String value from
Building an iPhone application. The delegate loads a SplashScreenView which sits there until the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.