Wednesday, March 21, 2012

Exclude User Defined Data Type owner from script

I need to exclude the User Defined Data Type owner when I script out my tables. I have set the ScriptingOptions.SchemaQualify = false which removes the owner from the table declaration but not from the User Defined Data Type.

I currently have to do a search and replace in order to remove all the [dbo].[MyDataType] from the CREATE TABLE scripts.

Any ideas how to fix this when creating my table script in SMO?

Given that the schema is part of the security framework of the database, why would you want to remove the schema from the create script? It would make the script unusable as a recovery tool.

No comments:

Post a Comment