you can connect PQ to SQL Server but there's not a great deal to go on from your note below.
for ex. the below is very simplistic illustration of how you could connect to a given db and execute a query to retrieve a dataset -- the query can leverage parameters (to a point) without getting too convoluted, and you can use temp tables etc such that your output is the result of multiple queries, which may help with performance etc
as always, the approach you choose to adopt will depend on the specifics of what you're trying to achieve.
Bookmarks