Amended SQL to insert resource data