Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Drop existing FileGroups and replace script

Author  Topic 

label
Posting Yak Master

197 Posts

Posted - 2013-06-04 : 15:57:02
I'm writing software that will take some previous versions of our Database (might vary wildly) and upgrade it to the current version. I'm looking for a way of removing all existing Filegroups that aren't in the latest version, then adding all the new ones.

Is there an easy way to accomplish this?

Something like :

ALTER DATABASE [MyDB]
--Remove all Filegroups that aren't current
--Add all required FileGroups.


bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-06-05 : 02:18:43
Refer the section "2) Updating Existing Database and Adding Filegroup" in the below link
http://blog.sqlauthority.com/2009/05/31/sql-server-create-multiple-filegroup-for-single-database/

--
Chandu
Go to Top of Page
   

- Advertisement -