![how to change file extension how to change file extension](https://i.ytimg.com/vi/JCYqLCb7vhY/maxresdefault.jpg)
MODIFY FILE (name = 'SSCTest', filename = 'F:\DATA\SSCTest.mdf')
#How to change file extension Offline#
Now, take the database OFFLINE using the below query.Ĭhange the File Extension of the respective database using query below. Run sp_helpdb and look for the file extension under Results panel. Let us first get the properties of the database.
![how to change file extension how to change file extension](https://www.online-tech-tips.com/wp-content/uploads/2008/02/change-file-extension.jpg)
The dataase is actually healthy, online, and accessible, but we are trying to get the extension corrected to. In this scenario, we have a database 'SSCTest' whose primary data file extension was renamed to. In that case, this article has the steps needed to bring the database back to an 'ONLINE' status.
![how to change file extension how to change file extension](https://i2.wp.com/www.softwarert.com/wp-content/uploads/disable-hide-extensions-for-known-file-types-windows-10-file-explorer-options.jpg)
In the case where a primary data file is created with a different file extension or accidently renamed to a different file extension, trying to revert the changes without following the proper steps may cause the database to change to a 'Recovery Pending' state. SQL Server works fine with any file extension but Microsoft recommends we use MDF, NDF and LDF. In general, the file extensions that we use for SQL Server data files are MDF (Primary Data File), NDF (Secondary Data File - this is optional), and LDF (Transaction Log File).