Undelete_action SQL execution from with the console?

(imported topic written by SystemAdmin)

Has anyone designed a way to run the SQL query and undelete_action statements used in SQL, but triggering it withing TEM?

In the outside change I were to get an audit that requires me to restore the actions used to patch endpoints, it is pretty overwhelming the amount of actions I would need to trigger the exec undelte_action within SQL against. We are talking thousands.

I am hoping that there is a better/ more efficient way to restore deleted actions into TEM.

(imported comment written by BenKus)

You can look at the stored procedure definition and modify it to do bulk undeletes… For 8.1, here is what it is:

update ACTION_FLAGS

set IsDeleted = 0,

ManyVersion = dbo.fn_IncrementManyVersion( ManyVersion ),

OriginServerID = NULL,

OriginSequence = NULL

where ActionID = @ActionID

So you can change the where clause to be all actions who are deleted or a list of actions…

Ben

(imported comment written by SystemAdmin)

Thank again, Ben. SQL stuff is pretty new to me, so I appreciate this. Ill post how it goes when I get it set-up.

(imported comment written by NoahSalzman)

Just remember, SQL is a standardized query language that you only have to learn once… as long as you never work with more than one database vendor. :slight_smile:

(See “Cross-vendor portability” in the wikipedia entry for SQL.)

(imported comment written by SystemAdmin)

This action would be run in the SQL management studio, right?

if so, that may cause me issues since our DBA’s do not allow non DBA’s to modify the database in this manner (or most any manner).

I am looking to try to do this within the console, if at all possible.