# How to copy certain number of records from 1 table to another in pega?

**URL:** <https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994>\
**Category:** General\
**Tags:** case-management\
**Created:** [August 3, 2026, 7:56pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994 "2026-08-03T19:56:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [August 3, 2026, 7:56pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/1 "2026-08-03T19:56:38Z")

</div>

There are 2 tables one has 1000 records and one has 0 records now we need to copy records number 51 to 71 from table 1 to table 2 with 0 records,now i am planning to do a obj browse but i am not sure how to give the index of records from table1,also if there is any alternate way,let me know.

Thanks

---

<div class="post-metadata">

**Author:** ![Tharun\_K\_T](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/tharun_k_t/32/23632_2.png) [@Tharun\_K\_T](https://forums.pega.com/u/Tharun_K_T)\
**Post date:** [August 4, 2026, 2:23am UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/2 "2026-08-04T02:23:20Z")

</div>

If your requirement is to copy or modify table data/columns at the database level, you can raise a CC request with the appropriate SQL query for the DBA team to execute.

---

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [August 4, 2026, 10:35am UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/3 "2026-08-04T10:35:24Z")

</div>

no actually how to move specifically record no 51 to 71 in table 2?i want to copy record numbers 51 to 71 in the other table with 0 records.

---

<div class="post-metadata">

**Author:** ![JayachandraSiddipeta](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/jayachandrasiddipeta/32/23334_2.png) [@JayachandraSiddipeta](https://forums.pega.com/u/JayachandraSiddipeta)\
**Post date:** [August 4, 2026, 6:10pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/4 "2026-08-04T18:10:54Z")

</div>

Hi @TanyaS58

What do you mean by “table”? Is it a work table containing **work objects** , or a table storing **data class instances**?

Depending on the type of records, the approach would differ.

**If these are data instances:**

- For a one-time migration, you could export the records to a CSV file.
- Copy only the required records (51-71) into another UTF-8 encoded CSV matching the structure of the target data type.
- Import the CSV into the target data type using the Data Designer import functionality.

**If these are work objects:**

- First, define the sort order that determines what constitutes records 51-71. Database tables do not inherently have a fixed “51st” or “71st” record unless a specific ordering is applied.
- Create a Report Definition with the required sorting and filtering criteria.
- Retrieve the required work objects and iterate through the desired records in an activity.
- Use the `pzInsKey` to open each source work object and create a corresponding work object in the target class (assuming the source and target classes have compatible structures).

Also, if this is a Pega implementation requirement rather than a one-time data migration, I would prefer a Report Definition-based approach over relying on Obj-Browse indexes, since Obj-Browse does not directly support retrieving records by position (for example, records 51-71) without defining pagination and ordering.

Could you share a bit more about the use case and clarify whether these are work objects or data instances? That would help in suggesting the most appropriate approach.

Regards

JC

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [August 4, 2026, 7:42pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/5 "2026-08-04T19:42:18Z")

</div>

> [@TanyaS58](#):
>
> There are 2 tables one has 1000 records and one has 0 records now we need to copy records number 51 to 71 from table 1 to table 2 with 0 records,now i am planning to do a obj browse but i am not sure how to give the index of records from table1,also if there is any alternate way,let me know.

A better approach is to use a Report Definition with appropriate filtering and sorting criteria to retrieve only the records that need to be migrated. Then iterate through the results and persist them into the target table. I hope index can be passed a parameter to filter the results.

If the source and target are Data Objects, you can leverage a Savable Data Page to encapsulate the save logic and keep the implementation reusable and maintainable. Report Definitions and Savable Data Pages as the preferred mechanisms for accessing and persisting data

---

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [August 4, 2026, 8:09pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/6 "2026-08-04T20:09:38Z")

</div>

hi @JayachandraSiddipeta these are work instances

---

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [August 4, 2026, 8:12pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/7 "2026-08-04T20:12:12Z")

</div>

hi @RameshSangili in Reports how can we retrive only a certain number of records?Is there any OOTB index property?

---

<div class="post-metadata">

**Author:** ![Tharun\_K\_T](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/tharun_k_t/32/23632_2.png) [@Tharun\_K\_T](https://forums.pega.com/u/Tharun_K_T)\
**Post date:** [August 5, 2026, 1:47am UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/8 "2026-08-05T01:47:48Z")

</div>

In Pega Report Definitions, you can limit the number of retrieved records using the Maximum number of rows to retrieve setting on the Data Access tab, or dynamically via the internal property `pyMaxRecords` @TanyaS58

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [August 5, 2026, 9:03am UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/9 "2026-08-05T09:03:21Z")

</div>

If these are work instances, why are you copying the data from one work table to another Worktable? What would happen to associated index tables,SLAs, Assignments, etc?? Are you supposed to copy that as well?

---

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [August 6, 2026, 9:23am UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/10 "2026-08-06T09:23:58Z")

</div>

HI @RameshSangili its just that we are bothered with copying the data of the instances.From 1 table to other.

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [August 6, 2026, 7:17pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/11 "2026-08-06T19:17:58Z")

</div>

I’m not about the intent about copying the Work objects from one table to another because the data could change overtime as when the case move forward with the workflow. Do you know the business justifications to copy the Worktable to another table?

---

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [August 7, 2026, 3:14pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/12 "2026-08-07T15:14:36Z")

</div>

@RameshSangili not much but the ask is that we want yo move a certain number of records to a blank table.

---

<div class="post-metadata">

**Author:** ![RameshSangili](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/rameshsangili/32/23377_2.png) [@RameshSangili](https://forums.pega.com/u/RameshSangili)\
**Post date:** [August 7, 2026, 5:59pm UTC](https://forums.pega.com/t/how-to-copy-certain-number-of-records-from-1-table-to-another-in-pega/12994/13 "2026-08-07T17:59:28Z")

</div>

Technically, it’s possible to migrate the records from your work table to another table. However, we need to understand about the intent to provide the correct recommendations. Work Objects has other depdendency tables like SLAs, Index, attachments, etc…
