SQL Server XML Schema Collection is definitely an interesting concept and that i think it is very helpful when creating dynamic data content. However when i work all things in applying Schema Collections, I've found it tough to maintain them.

Schema Collection DDL enables only CREATE and ALTER/ADD nodes to existing schemes.

CREATE XML SCHEMA COLLECTION [ <relational_schema>. ]sql_identifier AS 'XSD Content'
ALTER XML SCHEMA COLLECTION [ <relational_schema>. ]sql_identifier ADD 'Schema Component'

When you wish to get rid of any node from the schema you need to problem following DDL's.

  1. In the event that schema collection designated to some table column, you need to alter table to get rid of schema collection association from that column
  2. Drop the schema collection object
  3. Re-Create schema collection
  4. Alter table column to re-connect schema collection to that particular column.

This really is discomfort if this involves 100+ of schemes inside a collection. Also you need to re-create XML indexes once again, if any.

Any solutions, suggestions, methods to create this schema collection object editing process simpler?

To be sure with David that XML isn't the cure all i was told it might be, but you will find some situations where it's either inevitable or even the best tool to do the job. Schema maintenance is painful though. I have only a few to cope with but still lose hrs.

This script may help. It creates the table drops and adds you will need. It will have to mdified to incorporate UDFs or any other objects that may reference the XML schema. To create the Add schema claims, It is best to make use of the "Generate Scripts..." function within the tasks menu in Mgt Studio and save them off for Step Two from the script.

SET NOCOUNT ON

/* 
    1) Save cols to table var
*/
DECLARE @xmlCols TABLE (
numID INTEGER IDENTITY(1,1),
TBL nvarchar(1024),
COL nvarchar(1024),
SCH nvarchar(1024)
);

insert into @xmlCols (TBL,COL,SCH)
SELECT DISTINCT OBJECT_NAME(colm.object_id) AS 'TABLE', colm.name AS 'COLUMN', coll.name AS 'Schema' 
FROM  sys.columns colm
   inner JOIN     sys.xml_schema_collections coll
        ON colm.xml_collection_id = coll.xml_collection_id
ORDER BY OBJECT_NAME(colm.object_id), colm.name   

DECLARE @lastRow as int
DECLARE @currentRow as int
DECLARE @dbName as varchar(1024)
DECLARE @tableName as varchar(1024)
DECLARE @colName as varchar(1024)
DECLARE @schemaName as varchar(1024)
SET @lastRow = @@ROWCOUNT
SET @currentRow = @lastRow
SET @dbName = 'dbNAme'

print ''
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print '--!!!!! Scipt Schemas and Save in Mgt Studio !!!!'
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print ''


print ''
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print '--!!!!! Omit Schemas from COls !!!!'
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print ''
--omit the Schema for each column
WHILE @currentRow <> 0
BEGIN
    SELECT @tableName=TBL, @colName=COL, @schemaName=SCH from @xmlCols WHERE numID = @currentRow

    print N'ALTER TABLE [' + @tableName + N'] ALTER COLUMN ['+ @colName + N'] XML'

    set @currentRow = @currentRow -1
END

print ''
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print '--!!!!! drop your xml schema(s)  !!!!'
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print ''
SET @currentRow = @lastRow
WHILE @currentRow <> 0
BEGIN
    SELECT @tableName=TBL, @colName=COL, @schemaName=SCH from @xmlCols WHERE numID = @currentRow

    print N'DROP XML SCHEMA COLLECTION [dbo].['+@schemaName+']'

    set @currentRow = @currentRow -1
END

print ''
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print '--!!!!! CLean your Tables      !!!!'
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print ''

--clean up the tables
SET @currentRow = @lastRow
WHILE @currentRow <> 0
BEGIN
    SELECT @tableName=TBL, @colName=COL, @schemaName=SCH from @xmlCols WHERE numID = @currentRow

    print N'DBCC CleanTable (''' + @dbName + N''', ''' + @tableName + N''', 0)'

    set @currentRow = @currentRow -1
END

print ''
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print '--!!!!! Run XML Schema Scripts !!!!'
print '--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
print ''
SET @currentRow = @lastRow
WHILE @currentRow <> 0
BEGIN
    SELECT @tableName=TBL, @colName=COL, @schemaName=SCH from @xmlCols WHERE numID = @currentRow

    print N'ALTER TABLE [' + @tableName + N'] ALTER COLUMN ['+ @colName + N'] XML('+ @schemaName + N')'''

    set @currentRow = @currentRow -1
END

Hope it will help.