Automated Filegroup Migration in SQL Server -
Recently I was not created with an old database filegroups (just trying the default But damned if it is not the tedious task ever had to do and it is error prone. At one time, I realized that I accidentally took a 30 GB table before joining one of the price columns in PK (I think there is no progress indicator). So I had to start again. It's even worse when there are many dependencies in the table so I can not just drop the primary key; I have to leave every foreign key and rebuild it which refers to it leads to hundreds of rows of boilerplate; Multiply 100 by the table and it becomes obviously seam. My wrist is hurt. Has anyone come up with a shortcut for this? Could there be that there can be a device (once in the mind of the idea of use) which can do it? Perhaps someone had to go through this process before here and wrote their own device / script that they would like to share. SSMS will not work obviously - it is only non- Can generate migration scripts for -clustered indexes (and they are not indexed to be a lack of It is not that the syntax is so complex that I can not write a code generator for it. At least for the basic drop-and-rematch-the-primary-major part But all dependencies can be detected and generated drop / all scripts can add the script to the top of the land again and it is just threshold where it is tested automatically and completely compared to just every table To begin to feel like the more work has to have been done manually with the above example. So, the question is: Can this process be automated in any effective way? Do I have any options for what I wrote above? Thank you! primary restructuring
) And, among other things, take a new data file on any one of the cadence to stay on a SAN I know how to move data :
ALTER table with MyTable drop barrier PK_MyTable ([MyDB_Data] move to) ALTER Table MyTable Add Not to hinder PK_MyTable primary key cluster (MyID) [MyDB_Data]
unique
- at least on some tables, for better or worse, the cluster index is actually the primary key Yes, this is not a separate unique
constraint)
The easiest way to do this, IMO, would be to compare the schema to the script of your schema Use the tool (as a few examples), then clear that script to make the right object, in the correct file group. After doing this, you can use the same device to compare your new DB with the correct file group, and they will generate a script to migrate data for you. This is a worthwhile test with many people to find the most suitable for you.
Comments
Post a Comment