Renaming Filegroup in SQL Server | SansSQL

Friday, June 7, 2013

Renaming Filegroup in SQL Server

Renaming of a filegroup is SQL server can be done using T-SQL scripts as demonstrated below.
SELECT name AS BeforeRename FROM sys.filegroups

ALTER DATABASE SansSQL 
MODIFY FILEGROUP Secondary NAME=SansSQLFG

SELECT name AS AfterRename FROM sys.filegroups


Important thing to note here is, we will not be able to rename the Primary filegroup and when we try to rename the primary filegroup, we get an error which says
Msg 5012, Level 16, State 1, Line 1
The name of the primary filegroup cannot be changed.

2 comments:

indomakmur said...

very nice post, i surely really like this website, go on it https://royalcbd.com/product/cbd-gummies-10mg/

WELCOME TO SQL SERVER DBA said...

Very nice dear pls visit once for more details:- http://sqldbait.blogspot.com

Post a Comment

Ads