|
Hi, I need to create a new schema and a new file group on SQL 2005. Is there a possibility we can force all objects on the new schema be created on the new file group? Thanks Manoj
(comments are locked)
|
|
Your best bet is through training and policy - if you are looking for a default to force just the new schema objects to be forced to the new filegroup. Setting default filegroup will affect all new objects and force them to be created on the default filegroup. You would therefore need to specify the filegroup at creation time of the new object. without doubt, create the object with the schema specified, every time you create an object
May 18 '10 at 03:22 AM
Fatherjack ♦♦
Thanks. However Matt's solution will be ideal for me.
May 19 '10 at 10:36 PM
Manoj 1
(comments are locked)
|
|
In addition to setting the defualt filegroup as CirqueDeSQLeil says, you can alter the user to give them a default schema. This example is from Books Online:
But, just because you have a default schema doesn't mean that you can't override that schema when you create an object if that user has access to the ability to create objects on more than one schema.
(comments are locked)
|
|
Yes, there is a way to do exactly what you want with a DDL trigger. This one ensures objects in the dbo schema store their data in TestPartitionGroup1. Nice Solution. I hadn't considered preventing an object creation if it is not in the correct filegroup.
May 18 '10 at 12:42 PM
CirqueDeSQLeil
Thanks a lot. Although not the ideal solution i was looking for(rather than the warning the object creation itself), this will do my job. Excellent! Cheers Manoj
May 19 '10 at 03:22 AM
Manoj 1
@Manoj, no worries - glad to help...
May 19 '10 at 03:09 PM
Matt Whitfield ♦♦
(comments are locked)
|

