eventdata() - rename

  • Hi,

    I have a question regarding the use of EVENTDATA().

    If I rename a column X in table Table1, I am seeing the name of the rename column in /EVENT_INSTANCE/ObjectName. How I can find the name of the table (or parent object).

    Thanks,

  • looks like you are looking at the right tag, i think. maybe it's int he AlterTableActionList?

    http://schemas.microsoft.com/sqlserver/2006/11/eventdata/

    inthe ALTER_TABLE events,

    here's the XML tags:

    -<xs:complexType name="EVENT_INSTANCE_ALTER_TABLE"> -<xs:sequence>

    <!-- Basic Envelope -->

    <xs:element type="SSWNAMEType" name="EventType"/>

    <xs:element type="xs:string" name="PostTime"/>

    <xs:element type="xs:int" name="SPID"/>

    <!-- Server Scoped DDL -->

    <xs:element type="PathType" name="ServerName"/>

    <xs:element type="SSWNAMEType" name="LoginName"/>

    <!-- DB Scoped DDL -->

    <xs:element type="SSWNAMEType" name="UserName"/>

    <!-- Main Body -->

    <xs:element type="SSWNAMEType" name="DatabaseName"/>

    <xs:element type="SSWNAMEType" name="SchemaName"/>

    <xs:element type="SSWNAMEType" name="ObjectName"/>

    <xs:element type="SSWNAMEType" name="ObjectType"/>

    <xs:element type="EventTag_Parameters" name="Parameters" minOccurs="0"/>

    <xs:element type="AlterTableActionListType" name="AlterTableActionList" minOccurs="0"/>

    <xs:element type="EventTag_TSQLCommand" name="TSQLCommand"/>

    </xs:sequence>

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • looking again, i think there is a TargetObjectName in the RENAME schema.

    -<xs:complexType name="EVENT_INSTANCE_RENAME"> -<xs:sequence>

    <!-- Basic Envelope -->

    <xs:element type="SSWNAMEType" name="EventType"/>

    <xs:element type="xs:string" name="PostTime"/>

    <xs:element type="xs:int" name="SPID"/>

    <!-- Server Scoped DDL -->

    <xs:element type="PathType" name="ServerName"/>

    <xs:element type="SSWNAMEType" name="LoginName"/>

    <!-- DB Scoped DDL -->

    <xs:element type="SSWNAMEType" name="UserName"/>

    <!-- Main Body -->

    <xs:element type="SSWNAMEType" name="DatabaseName"/>

    <xs:element type="SSWNAMEType" name="SchemaName"/>

    <xs:element type="SSWNAMEType" name="ObjectName"/>

    <xs:element type="SSWNAMEType" name="ObjectType"/>

    <xs:element type="SSWNAMEType" name="TargetObjectName"/>

    <xs:element type="SSWNAMEType" name="TargetObjectType"/>

    <xs:element type="SSWNAMEType" name="NewObjectName"/>

    <xs:element type="EventTag_Parameters" name="Parameters" minOccurs="0"/>

    <xs:element type="EventTag_TSQLCommand" name="TSQLCommand"/>

    </xs:sequence>

    </xs:complexType>

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Oh, awesome !

    Thanks

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply