secondary data file

  • By mistake I had created a secondary data file ( added _2 ) also with .mdf  extension instead of .ndf  and started the database .will that create any issues?
    Can I  rename the extension to .ndf from .mdf?

  • No, the naming conventions for the files isn't "hard coded" into SQL.  You could've used any extension (except probably executables) for the second file with no problems (beyond the obvious if you used something like TXT)

    As for re-naming it, I would think if you follow the procedure for moving a database file (https://docs.microsoft.com/en-us/sql/relational-databases/databases/move-user-databases ) it will work out fine, just keep the path the same.  So for step 2 in the directions at the link, instead of moving the file(s), you'll rename it with an NDF extension and continue on.

  • jasona.work - Thursday, June 1, 2017 2:11 PM

     (beyond the obvious if you used something like TXT)

    I've done that. SQL didn't care

    (to be technical, I created the data file as an alternate stream of a text file, and the log as a second alternate stream of the same text file. SQL didn't care)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster - Thursday, June 1, 2017 2:26 PM

    jasona.work - Thursday, June 1, 2017 2:11 PM

     (beyond the obvious if you used something like TXT)

    I've done that. SQL didn't care

    (to be technical, I created the data file as an alternate stream of a text file, and the log as a second alternate stream of the same text file. SQL didn't care)

    What I pictured as a problem with using TXT as the extension would be something boneheaded like accidentally opening the file in Notepad (or your text editor of choice.)  Not *likely* to happen in that case, but possible...

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply