Last active
December 22, 2023 00:04
-
-
Save etherealHero/ab10f8d564484ff1c97193c429786682 to your computer and use it in GitHub Desktop.
NodeJS mssql by edge-js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const edge = require('edge-js'); | |
const getProcedures = edge.func('sql', { | |
source: "SELECT TOP 10 name FROM sys.procedures", | |
connectionString: "Persist Security Info=False;Integrated Security=true;Initial Catalog=<database>;server=<server>" | |
}); | |
const init = async () => { | |
const res = await new Promise((res, rej) => { | |
getProcedures(null, function (error, result) { | |
if (error) rej(error); | |
res(result); | |
}); | |
}) | |
res.map(a => console.log(a.name)); | |
} | |
init(); | |
/* | |
$ npm i edge-js edge-sql | |
$ node edge-sql.js | |
> pp_GetObjectFromPageId | |
sp_Locks | |
sp_MScleanupmergepublisher | |
sp_MSrepl_startup | |
sp_who3 | |
$ | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment