-2

How do you modify filepath of a database file that is inside a filegroup?

Just the normal and direct way?

Alter database []
Modify file (name='', newfilepath='')

Or

Alter database []
Modify filegroup []
Modify file (name='', newfilepath='')
Erik Reasonable Rates Darling
  • 45,549
  • 14
  • 145
  • 532

1 Answers1

2

Both options are incorrect. For the first option newfilepath do not exists. Use FILENAME instead

From Move User Databases (Microsoft Learn | SQL)

ALTER DATABASE mydatabase_name 
    MODIFY FILE ( 
                  NAME = logical_name, 
                  FILENAME = 'new_path\os_file_name'
                );
John K. N.
  • 18,854
  • 14
  • 56
  • 117
SergeyA
  • 1,522
  • 1
  • 5
  • 9