OneScript Team Blog

A world of automation script samples based on IT Pros' real-world tasks

[Script Of July 10] How to check if SQL Server database files are marked as sparse files

[Script Of July 10] How to check if SQL Server database files are marked as sparse files

  • Comments 1
  • Likes
image image
July
10
image

Script Download:  
The script is available for download from http://gallery.technet.microsoft.com/How-to-check-if-SQL-Server-af01ebb9 (SQL) and http://gallery.technet.microsoft.com/How-to-check-if-SQL-Server-23bace0c (powershell).  You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment. 

Only files associated with a database snapshot should be marked as sparse files. If a regular database is marked as a sparse file, you might encounter unexpected performance degradation and errors during normal activities. This script will find all the database files marked as sparse files in an instance.

Some people asked how to check if SQL Server database files marked as sparse files. This script will help demo how to find out all the database files marked as sparse files.

You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Thanks for sharing this information it was very helpful.

    Regards
    MA Subhan
    www.upskilltechnologies.com