How To Move SQL Server Database Files To A Different Location

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • If you ever run into the problem where your database files are getting too large and you want to move the database files to a different drive with more storage then this tutorial will answer your question.
    📺 How To Build A MS SQL Server SQL Query Tool Using Excel: • Building A MS SQL Serv...
    ► Buy Me a Coffee? Your support is much appreciated!
    -------------------------------------------------------------------------------------------
    ☕ Paypal: www.paypal.me/...
    ☕ Venmo: @Jie-Jenn
    💸 Join Robinhood with my link and we'll both get a free stock: bit.ly/3iWr7LC
    ► Support my channel so I can continue making free contents
    ---------------------------------------------------------------------------------------------------------------
    🌳 Becoming a Patreon supporter: / jiejenn
    🛒 By shopping on Amazon → amzn.to/2JkGeMD
    📘 Facebook Page → / madeinpython
    📘 More tutorial videos on my website → LearnDataAnaly...
    ✉️ Business Inquiring: UA-cam@LearnDataAnalysis.org
    #SQLServer #MSSQLServer #MoveDatabaseFile

КОМЕНТАРІ • 26

  • @ledickin69
    @ledickin69 Рік тому +2

    Very helpful, thank you.
    For SQLServer Express the file permissions on a Windows computer, the userid is ‘NT SERVICE\MSSQL$SQLEXPRESS’
    SQL Server Management Studio needs be opened as “Run as administrator” to allow the database to be attached.

  • @danielrooein6798
    @danielrooein6798 Рік тому +1

    This worked nicely! Thanks for the great video!

  • @webcoderltd
    @webcoderltd 6 днів тому

    Nice instructions - thank you. I am wondering what is the advantage of doing it manually as opposed to using a simple Detach from tasks, moving the database files physically and then Attach them from a different location which is much easier? I understand that detached databases disappear from SQL Studio and could not find any proper info (still looking) on what exactly happens to user accounts and their permissions to such databases. Yours looked like it's still listed under databases and certain setttings such as db files paths are only modified not affeecting users and their permissions.

  • @elricho72
    @elricho72 2 роки тому +2

    Great video, thank's for share

  • @haripsd
    @haripsd 14 днів тому

    Good one

  • @ignaciokairuz
    @ignaciokairuz Рік тому +1

    Very Helpful!!

  • @fabianhm77
    @fabianhm77 9 місяців тому

    Great video, so helpful, thanx.

  • @apokanou854
    @apokanou854 3 місяці тому

    Great video.

  • @totallytrading3165
    @totallytrading3165 Рік тому

    Thank you for the video. Helped!

  • @namgaywangchuk1737
    @namgaywangchuk1737 8 місяців тому

    thank you

  • @michelleurbano0809
    @michelleurbano0809 2 місяці тому

    Nice vid ! 🎉 but a question if youre going to change the location of the database file that is inside a filegroup? is it the same way just modify file name and filepath directly?

    • @jiejenn
      @jiejenn  2 місяці тому

      I believe it needs to be a absolute file path

    • @michelleurbano0809
      @michelleurbano0809 2 місяці тому

      @@jiejenn 'coz I have a situation where a filegroup contains two datafiles but have different location and I need to put the other datafile to the same location but havent tried it, a normal modify file or needs an alter the whole filegroup and then just changed the filepath 🥹 😅 but I'll search further thanks for replying.

  • @MyLubimishBabyLove
    @MyLubimishBabyLove 5 місяців тому

    And in which cases we need to use Detach/Attache or its always can be replaced by just moving db to offline? If I need also change the file name I also can use this method?

  • @SonixPoland
    @SonixPoland Рік тому

    Thank you :)

    • @jiejenn
      @jiejenn  Рік тому

      Glad the video helped.

  • @jamescorbett778
    @jamescorbett778 Рік тому

    Great Video, I'm stuck at file permissions, I can see that MSSQLSERVER has permission for the original file location, but I can't find that userid when granting permission in the new folder. I have also tried CPT South Austrailias 'NT SERVICE\MSSQL$SQLEXPRESS' which can't be found either. any help greatly appreciated.

    • @jiejenn
      @jiejenn  Рік тому +1

      I am not familiar with the issue, I would probably post your question on Stack Overflow for better assistant.

  • @the_daftkid
    @the_daftkid 6 місяців тому

    Is this applicable for a database transfer to an external drive? Thank you

    • @jiejenn
      @jiejenn  6 місяців тому +1

      You can, as long as the drive is attached. Drive type may impact query speed.

    • @the_daftkid
      @the_daftkid 6 місяців тому

      @@jiejennThank you !!

  • @s97ai
    @s97ai Рік тому

    Is there a manual way of doing that without typing in the commands

    • @jiejenn
      @jiejenn  Рік тому

      If there is a manual way, I probably don't know how to.

    • @ignaciokairuz
      @ignaciokairuz Рік тому

      @@jiejenn I think it can be done with sql server configuration manager but it didn't work for me. this worked just great!