I am trying to use T-SQL to modify the file names of the mdf files and the ldf files. I think I can do it using the MODIFY FILE syntax.
This is what I have:
ALTER DATABASE [IRLRV3]
MODIFY FILE ( NAME = [C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\IRLRV2.mdf],
NEWNAME = [C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\IRLRV3.mdf] )
However, when I run it, I get the following error:
Msg 5041, Level 16, State 1, Line 1
MODIFY FILE failed. File 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\IRLRV2.mdf' does not exist.
Now, this file does exist, so something tells me, I'm not doing the syntax correctly.