Quantcast
Channel: THWACK: All Content - All Communities
Viewing all articles
Browse latest Browse all 20202

Tables with Triggers(?): The target table of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause

$
0
0

When attempting to add a volume through the SDK, I'm getting this error:

 

New-SwisObject : The target table 'dbo.Volumes' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.

 

I DO have SQL triggers on the volumes table, and I wanted to see if the message was that literal. If this is related to my triggers, is there a proper way to construct my triggers or powershell so that these two don't bump into each other?

The triggers are in use to enforce custom properties as volumes come and go with great frequency for me, and they save me a lot of grief in the long run.

 

I'm using Powershell to interface with the SDK in this function:

function ImportVolume ($NodeID, $VolSNMPIndex, $VolumeCaption, $IPAddress, $VolumeType, $VolumeTypeID, $VolumeTypeIcon, $VolumeDescription )

{

    $newVolProps = @{

    NodeID=[INT]$NodeID;

    VolumeIndex=[INT]$VolSNMPIndex;

    Status=0;

    VolumeType =$VolumeType;

    VolumeTypeID=[INT]$VolumeTypeID;

    VolumeTypeIcon =$VolumeTypeIcon;

    Caption=$VolumeCaption;

    VolumeDescription=$VolumeDescription;

    VolumeSpaceAvailable=0;

    PollInterval=120;

    StatCollection=15;

    RediscoveryInterval=30;

    NextRediscovery=[DateTime]::UtcNow;

    }

 

 

    $newVolUri = New-SwisObject $swis -EntityType "Orion.Volumes" -Properties $newVolProps

    $VolProps = Get-SwisObject $swis -Uri $newVolUri

 

    $importPollers = @(Import-CSV $importFile) |

    Where { $_.IP -eq $IPAddress } |

    Where { $_.SNMPIndex -eq $VolSNMPIndex } |

    Where { $_.EntityType -eq "VolumePoller"}

 

    FOREACH ( $VolPoller in $importPollers )

    {

        $PollerType = $IntPoller.Caption

        $poller = @{

            PollerType=$PollerType;

            NetObject="V:"+$VolProps["VolumeID"];

            NetObjectType="V";

            NetObjectID=$VolProps["VolumeID"];

        }

        $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

    }

}


Viewing all articles
Browse latest Browse all 20202

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>