'How to change shared datasource in Report Server SSRS using t-sql and ReportServer database.?

I need to change a shared datasource for more than a hundred reports from Report Server. (the step below on a snip)

So for each report on a server I'd go to "Manage" --> "Datasource" and from there select datasource I need.

Is any way I can do that using t-sql in ReportServer database?

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source