Hi, Is it possible to move the existing database objects like tables, views, indexes, etc., to a newly created file group? Will it be an advisable thing to do? From books online, I could not collect details regarding this. We have a database in a reasonable size, we find it difficult to restore it due to its size, say lack of resources. We decided to create new file groups and transfer the existing objects to them. Will the existing databse remain intact if we do so? Please provide me more details, thank you. Regards, Deva
Hi,<br />yes it can be done with *Alter Object (table/index/views)* <br /><br />this is from BOL <br />alter table yrtable<br />ON {filegroup | DEFAULT}<br /><br />Specifies the storage location of the index created for the constraint. If filegroup is specified, the index is created in the named filegroup. If DEFAULT is specified, the index is created in the default filegroup. If ON is not specified, the index is created in the filegroup that contains the table. If ON is specified when adding a clustered index for a PRIMARY KEY or UNIQUE constraint, the entire table is moved to the specified filegroup when the clustered index is created.<br /><br />DEFAULT, in this context, is not a keyword. DEFAULT is an identifier for the default filegroup and must be delimited, as in ON "DEFAULT" or ON [DEFAULT].<br /><br />please search the forum for filegroup its already discussed earlier ,not easy to advice but *it depends* to move or not move / will increase performance or not .<br /><br /><img src='/community/emoticons/emotion-1.gif' alt='' /><br />Regards<br /><br />Hemantgiri S. Goswami<br />ghemant@gmail.com<br />"Humans don't have Caliber to PASS TIME , Time it self Pass or Fail Humans" - by Hemantgiri S. Goswami<br />
Hi Hemant, Thank you, what you have mentioned is applicable during column level or table level constraints creation for the existing tables. In my case, table and all its associated objects are already availble, now, I would like to move as it is to another file group. It can be done from Enterprise Manager, but it is a tedious task for the administrator, he has to do one by one. Instead of that, I would like to give him a script file which will keep his job simple and it will be error free as well. As you said, I will search in the existing posts about this, thanks again. Regards, Deva
quote:Originally posted by sqldev Hi, Is it possible to move the existing database objects like tables, views, indexes, etc., to a newly created file group? Will it be an advisable thing to do? From books online, I could not collect details regarding this. We have a database in a reasonable size, we find it difficult to restore it due to its size, say lack of resources. We decided to create new file groups and transfer the existing objects to them. Will the existing databse remain intact if we do so? Please provide me more details, thank you. Regards, Deva ---------------------------- check this http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/managesql.mspx SURYA Be pure to do good.[Vivekananda]
Hi, Thank you surya, I have found out an alternative for my requirement, while creating clustered index, we can specify the file group where the index will be created, at this time, data will be moved to the mentioned file group along with the index creation. If a table does not contain any clustered index, we need to move the data to a new object, drop the old object and rename the newly created object. If any one has any other way of achieving it, please share it with me, thank you. Regards, Deva
Hello All, I want to move a file from primary file group to secondary file group, Can I do it through SSMS or can anybody tell me the sql command to do this. I tried below but didn't worked ALTER DATABASE pubs MODIFY FILE ( NAME = pubs_Data_1 ) TO FILEGROUP SECONDARY Rohit
Not that easy for SQL2000 - refer to http://www.sqljunkies.ddj.com/HowTo/B9F7F302-964A-4825-9246-6143A8681900.scuk for all your doubts.