Is it possible to change the logical name given to a database file?
The reason I want to do this is that we have several remote SQL Servers, and
some have the logical file names consistenly named the same, which is what
we want, but some do not. What's the best way to get all of the logical file
names the same, i.e. consistent on each and every remote SQL Server. N.B.
These database are in production but can be, and are taken offline for
updates (schema, SPs, reference data, etc.).
Thanks.
Michael MacGregor
Database ArchitectHi
On Jun 18, 3:44 pm, "Michael MacGregor" <nos...@.nospam.com> wrote:
> Is it possible to change the logical name given to a database file?
> The reason I want to do this is that we have several remote SQL Servers, a
nd
> some have the logical file names consistenly named the same, which is what
> we want, but some do not. What's the best way to get all of the logical fi
le
> names the same, i.e. consistent on each and every remote SQL Server. N.B.
> These database are in production but can be, and are taken offline for
> updates (schema, SPs, reference data, etc.).
> Thanks.
> Michael MacGregor
> Database Architect
You can with the ALTER DATABASE command e.g.
USE master
GO
CREATE DATABASE test1
GO
USE test1
GO
EXEC sp_helpfile
GO
ALTER DATABASE Test1
MODIFY FILE
(NAME = test1,
NEWNAME = 'DataFile')
GO
EXEC sp_helpfile
GO
John|||D'oh! Thanks for pointing that out to me. I think I need glasses. ;-)
MTM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment