Maybe the answer is existing somewhere but I couldn't find one for this requirement.
The SQL script can contain any kind of commands:
- select count(*)....
- select Field1, Field2, Field3...
- insert into Table1 (...) values (...)
- alter table Table1
- exec ProcName1...
After executing each command, its results should be captured similarly to SSMS. So results of the above commands look as below:
- A result with one column represents number of rows (for the count)
- A result set list all rows (for select)
- A number of inserted rows (for insert)
- Command(s) completed successfully (for alter) ...
This answer sounds good (https://stackoverflow.com/a/1728859/4903729) but results can't be captured.
Any suggestion is much appreciated. Thanks !
Update: found this is helpful https://github.com/DbUp/DbUp, but it seems not giving back the outputs