Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More code samples for Multiple Result Sets (like issue 113) #281

Open
bkwdesign opened this issue Mar 22, 2023 · 1 comment
Open

More code samples for Multiple Result Sets (like issue 113) #281

bkwdesign opened this issue Mar 22, 2023 · 1 comment

Comments

@bkwdesign
Copy link

While the resolution to issue #113 technically speaks to my problem, I'm just calling my stored proc in the context of a regular query issued from a pool, and cannot figure out how to adapt the example you gave in #113 that uses the ProcedureManager

            let multiResultSqlStatement = `dbo.sp_help [SomeTable]`;         

            const poolPromise = configObj.pools['MyNamedPool'].connect();

            let records = await poolPromise.then((pool) => {
                return pool.query(multiResultSqlStatement);
            }).then(result=>{
                
                return result;
            }).catch(err=>{
                console.log(err);
            });

I need to know either:
A. How to use pools together with ProcedureManager
or
B. an expanded code snippet showing how to detect the additional results using query

@bkwdesign
Copy link
Author

I am not using the native pools, fwiw, but rather the ones from mssql package.

        configuration.pools = {};

        configuration.pools["pool_1"] = new sql.ConnectionPool({  //https://www.npmjs.com/package/mssql#connection-pools
            connectionString: configuration.connectionString1,
            options:{trustedConnection:true}
        });

        configuration.pools["pool_2"] = new sql.ConnectionPool({
            connectionString: configuration.connectionString2,
            options:{trustedConnection:true}
        });

        return configuration;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant