How to retrive action history from database and I need only parent ID?
Refering -
select P.ID as
’ActionID’, ActionResult.ComputerID, P.Name, P.Username, P.CreationTime as
’StartTime’, CONVERT( int, dbo.fn_ExtractField(
‘SourceFixletId’, 0, P.Fields )) AS
’FixletID’, CONVERT( varchar(128), dbo.fn_ExtractField(
‘SourceSiteName’, 0, P.Fields )) AS
’Sitename’, ActionStateString.ActionStateString AS
’ActionStatus’ from ACTION_DEFS P, VERSIONS V, ACTIONRESULTS ActionResult, ACTIONSTATESTRINGS ActionStateString, COMPUTERS C, ACTION_FLAGS A where P.ContentType = 7 AND V.Sitename =
‘ActionSite’ AND P.ID = V.ID AND P.Version = V.LatestVersion AND ActionResult.ActionID = P.ID AND ActionStateString.ActionState = ActionResult.State AND C.ComputerID = ActionResult.ComputerID AND C.IsDeleted = 0 AND A.ActionID = P.ID AND A.IsDeleted = 0 AND dbo.fn_ExtractField(
‘SourceFixletId’, 0, P.Fields ) IS NOT NULL AND dbo.fn_ExtractField(
‘SourceSiteName’, 0, P.Fields ) IS NOT NULL
Can you wrap the code in a code block? ( edit the post, select the code, click the “</>” button )
Can you provide links to what you are referring to, as well as more background?
select P.ID as
'ActionID', ActionResult.ComputerID, P.Name, P.Username, P.CreationTime as
'StartTime', CONVERT( int, dbo.fn_ExtractField(
'SourceFixletId', 0, P.Fields )) AS
'FixletID', CONVERT( varchar(128), dbo.fn_ExtractField(
'SourceSiteName', 0, P.Fields )) AS
'Sitename', ActionStateString.ActionStateString AS
'ActionStatus' from ACTION_DEFS P, VERSIONS V, ACTIONRESULTS ActionResult, ACTIONSTATESTRINGS ActionStateString, COMPUTERS C, ACTION_FLAGS A where P.ContentType = 7 AND V.Sitename =
'ActionSite' AND P.ID = V.ID AND P.Version = V.LatestVersion AND ActionResult.ActionID = P.ID AND ActionStateString.ActionState = ActionResult.State AND C.ComputerID = ActionResult.ComputerID AND C.IsDeleted = 0 AND A.ActionID = P.ID AND A.IsDeleted = 0 AND dbo.fn_ExtractField(
'SourceFixletId', 0, P.Fields ) IS NOT NULL AND dbo.fn_ExtractField(
'SourceSiteName', 0, P.Fields ) IS NOT NULL
You need to select all of the code at once and click the “</>” button. You can edit your post to do this.