SQL Server Video Validate File Properties Prior to Importing Data

By:   |   Updated: 2014-07-07   |   Comments   |   Related: > PowerShell




Problem / Solution

Sometimes we need to import a file only after we know that it's the right size or the right length. If the file falls short of a certain length or size, it may be because the file doesn't contain all the data or is in a corrupt state. By adding a measure to check the size and length prior to importing we can prevent data problems. In this video, we will look at how to check the number of rows and the file size using two different methods. This video will show how you can incorporate pre-import checks to your processing using either PowerShell or C# code.

Key Learning Items

  • Verify length in PowerShell.
  • Verify size in PowerShell (MB or GB).
  • Verify length in C#.
  • Verify size in C# (MB or GB).

Read Companion Tip
Click Here


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Tim Smith Tim Smith works as a DBA and developer and also teaches Automating ETL on Udemy.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips


Article Last Updated: 2014-07-07

Comments For This Article

















get free sql tips
agree to terms