Re: Changing physical file name
From: Dinesh T.K (tkdinesh_at_nospam.mail.tkdinesh.com)
Date: 05/12/04
- Next message: Hugo Kornelis: "Re: Char and Varchar"
- Previous message: Bob Lee: "Re: Validation query"
- In reply to: Simon: "Changing physical file name"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 03:01:45 +0530
Simon,
Detach the database using sp_detach_db.Rename the files.Then attach it back
using sp_attach_db mentioning the new names.For syntax 'ndetails for the two
commands, refer BooksOnLine.
-- Dinesh SQL Server MVP -- -- SQL Server FAQ at http://www.tkdinesh.com "Simon" <me@me.me> wrote in message news:#GskXRGOEHA.2560@TK2MSFTNGP11.phx.gbl... > > I have a database where I'd like to change the physical file name > of one of it's data files. The physical file is tied to a filegroup. > > It looks something like this > > name fileid filename filegroup > FG1 3 c:\mydb_fg1.NDF FG1 > > > I know I can change the either the name or filegroup using the following.... > > alter database mydb MODIFY FILE (NAME = FG1, NEWNAME = NEWFG) > alter database mydb MODIFY FILEGROUP FG1 NAME = NEWFG > > ... but how can I rename the actual filename so it reads as > > c:\mydb_newfg.NDF > > > ? > >
- Next message: Hugo Kornelis: "Re: Char and Varchar"
- Previous message: Bob Lee: "Re: Validation query"
- In reply to: Simon: "Changing physical file name"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|