/****** Script for SelectTopNRows command from SSMS  ******/
SELECT 
	CASE AuditDMLAction
		WHEN 'Update' THEN 'UPDATE s_action_list SET action_type='+CAST(action_type AS VARCHAR(2))+', condition_field='''+COALESCE(condition_field,'')+''', result_object='''+COALESCE(result_object,'')+''', result_field='''+COALESCE(result_field,'')+''', default_order='''+COALESCE(default_order,'')+''', created_by='''+created_by+''', created_date='''+CONVERT(VARCHAR, created_date, 120)+''', modified_by='''+modified_by+''', modified_date='''+CONVERT(VARCHAR, modified_date, 120)+''', is_delete='''+is_delete+''' WHERE action_name='''+action_name+''''
		WHEN 'Insert' THEN 'INSERT INTO s_action_list
           (action_name
           ,action_type
           ,condition_field
           ,result_object
           ,result_field
           ,default_order
           ,created_by
           ,created_date
           ,modified_by
           ,modified_date
           ,is_delete)
     VALUES
           ('''+action_name+'''
           ,'''+CAST(action_type AS VARCHAR(2))+'''
           ,'''+COALESCE(condition_field,'')+'''
           ,'''+COALESCE(result_object,'')+'''
           ,'''+COALESCE(result_field,'')+'''
           ,'''+COALESCE(default_order,'')+'''
           ,'''+created_by+'''
           ,'''+CONVERT(VARCHAR, created_date, 120)+'''
           ,'''+modified_by+'''
           ,'''+CONVERT(VARCHAR, modified_date, 120)+'''
           ,'''+is_delete+''')'
	ELSE '?'
	END AS a,

	[action_name]
      ,[action_type]
      ,[condition_field]
      ,[result_object]
      ,[result_field]
      ,[default_order]
      ,[max_result_row]
      ,[created_by]
      ,[created_date]
      ,[modified_by]
      ,[modified_date]
      ,[is_delete]
      ,[AuditDataState]
      ,[AuditDMLAction]
      ,[AuditUser]
      ,[AuditDateTime]
      ,[UpdateColumns]
  FROM [db_edits].[dbo].[log_s_action_list]
WHERE
	AuditDataState = 'New'
	AND AuditDateTime >= '2018-01-01'
ORDER BY
AuditDateTime