I have a string variable which is named query. It’s value is:
select col1, col2 from tab1
inner join (select col3, col4 from tab2)
Would it be possible to apply a treatment to this string variable to replace the first appearance of select with select top 100?
The string variable should become:
select top 100 col1, col2 from tab1
inner join (select col3, col4 from tab2)
This will make sure to only replace the first instance, instead of all instances of select. It can also be easily modified if you need to change what you are replacing by changing the regex.