Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Header Validation of an uploaded file

Header Validation of an uploaded file

Header Validation of an uploaded file


I have a stored procedure in SQL 2008 which does certain calculations based on business rules. In order to do the calculations, we need to supply data in the form of file in .csv format. As of now, the stored procedure is unable to process the data, if the data file has a header.

My request is, is there a way we can handle this situation by implementing some validation checks in the beginning?

I mean check the column header for the required format, and if the format doesnt matches, give an error message saying calculation is not applicable.

Can we do like this? Please let me know. This helps me a lot.


RE: Header Validation of an uploaded file

Well, how about checking the files before processing them in a stored procedure? I'm quite confident it can be done in T-SQL, if all else fails by error handling, but I would do it before feeding the sql server, anyway, because any multiple purpose language (C/C++/C#/Java/VB/PHP whatever) is better in file processing and could rewrite the CSV file without the first line.

Why don't you ask your question in the forum183: Microsoft SQL Server: Programming?

Bye, Olaf.

RE: Header Validation of an uploaded file


thank you very much. Per your suggestion, i will raise this question in programming forum with few additional questions.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close