Express/Connect session store backed by Microsoft SQL Server, built on the node-mssql driver. Current stable version is 6.0.0, maintained as a revival of the abandoned connect-mssql package. It supports configurable TTL, auto-removal of expired sessions, UTC time handling, connection retries, and emits events for connect, error, and session errors. Distinguished from alternatives by its focus on MSSQL and its compatibility with both CommonJS and ESM via TypeScript declarations.
npm install connect-mssql-v2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an Express server with MSSQL session store, incrementing a view counter on each visit.
Provide config object with 'server' and 'database' keys instead of 'url'.
Run the provided CREATE TABLE script before first use.
Switch to: new MSSQLStore({ user, password, server, database, options })Use default import: import MSSQLStore from 'connect-mssql-v2' or const MSSQLStore = require('connect-mssql-v2').Listen for 'sessionError' event to catch internal store errors.
Use const MSSQLStore = require('connect-mssql-v2'); or import MSSQLStore from 'connect-mssql-v2';Verify SQL Server is running, check config, and ensure TCP/IP is enabled.
Run CREATE TABLE script provided in the README.
Ensure table has columns: [sid] nvarchar(255) NOT NULL PRIMARY KEY, [session] nvarchar(max), [expires] datetime.