Say i have a table with an xml field. this xml field contains it's own pseudo table, so is there a way to force data entered into new records of the main table for this xml field to use the same structure? hmmm sounds confusing... example:
I'd like to force all records within the table "email_column" to use:
of course the <column> part is optional and would very depending on number of columns in the view or stored proc.
Code:
INSERT INTO email_column (xColumn) VALUES (
'<object type="view">
<name>livefeed_unprocessed</name>
<remote>1</remote>
<provider>SQLNCLI</provider>
<connectionstring>SERVER=tatooine.grscorp.com;Trusted_Connection=yes;</connectionstring>
<database_name>OEN</database_name>
<column>
<column_name>clientkey_id</column_name>
<column_type>INT</column_type>
</column>
<column>
<column_name>name</column_name>
<column_type>VARCHAR(50)</column_type>
</column>
<column>
<column_name>qty</column_name>
<column_type>INT</column_type>
</column>
<column>
<column_name>oldest_record</column_name>
<column_type>DATETIME</column_type>
</column>
</object>')
CREATE PRIMARY XML INDEX idx_xColumns on email_column (xColumn)
CREATE XML INDEX idx_xColumn_Path on email_column (xColumn)
USING XML INDEX idx_xColumns FOR PATH
CREATE XML INDEX idx_xColumn_Property on email_column (xColumn)
USING XML INDEX idx_xColumns FOR PROPERTY
I'd like to force all records within the table "email_column" to use:
Code:
<object type="view">
<name>livefeed_unprocessed</name>
<remote>1</remote>
<provider>SQLNCLI</provider>
<connectionstring>SERVER=tatooine.grscorp.com;Trusted_Connection=yes;</connectionstring>
<database_name>OEN</database_name>
<column>
</column>
</object>
of course the <column> part is optional and would very depending on number of columns in the view or stored proc.