{"id":21629050,"url":"https://github.com/cityssm/node-mssql-query-replicate","last_synced_at":"2026-02-12T07:37:20.223Z","repository":{"id":259216789,"uuid":"874801103","full_name":"cityssm/node-mssql-query-replicate","owner":"cityssm","description":"A simple way to replicate the results of a SQL Server query from one database into a table in another.","archived":false,"fork":false,"pushed_at":"2025-01-20T23:27:00.000Z","size":358,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T20:25:39.604Z","etag":null,"topics":["mssql","sql-server"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@cityssm/mssql-query-replicate","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cityssm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-18T13:39:23.000Z","updated_at":"2024-10-23T17:43:54.000Z","dependencies_parsed_at":"2024-10-23T15:52:54.587Z","dependency_job_id":"1f5c0a79-0120-4b68-9325-c42c08f48a2a","html_url":"https://github.com/cityssm/node-mssql-query-replicate","commit_stats":null,"previous_names":["cityssm/node-mssql-query-replicate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cityssm/node-mssql-query-replicate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-mssql-query-replicate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-mssql-query-replicate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-mssql-query-replicate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-mssql-query-replicate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cityssm","download_url":"https://codeload.github.com/cityssm/node-mssql-query-replicate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cityssm%2Fnode-mssql-query-replicate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29361641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mssql","sql-server"],"created_at":"2024-11-25T02:04:54.593Z","updated_at":"2026-02-12T07:37:20.208Z","avatar_url":"https://github.com/cityssm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-mssql-query-replicate\n\n[![npm](https://img.shields.io/npm/v/@cityssm/mssql-query-replicate)](https://www.npmjs.com/package/@cityssm/mssql-query-replicate)\n[![Maintainability](https://api.codeclimate.com/v1/badges/96bf1721c5f5e5c27c6c/maintainability)](https://codeclimate.com/github/cityssm/node-mssql-query-replicate/maintainability)\n[![codecov](https://codecov.io/gh/cityssm/node-mssql-query-replicate/graph/badge.svg?token=XEAVOI1Q15)](https://codecov.io/gh/cityssm/node-mssql-query-replicate)\n[![Coverage Testing](https://github.com/cityssm/node-mssql-query-replicate/actions/workflows/coverage.yml/badge.svg)](https://github.com/cityssm/node-mssql-query-replicate/actions/workflows/coverage.yml)\n[![DeepSource](https://app.deepsource.com/gh/cityssm/node-mssql-query-replicate.svg/?label=active+issues\u0026show_trend=true\u0026token=YtY-ag7MTg2DFyDPqGE39IlF)](https://app.deepsource.com/gh/cityssm/node-mssql-query-replicate/)\n\nA simple way to replicate the results of a SQL Server query from database into a table in another.\n\nHelpful for creating a copy of a select table for backup, reporting, or development purposes.\n\n## Installation\n\n```sh\nnpm install @cityssm/mssql-query-replicate\n```\n\n## Usage\n\n```javascript\nimport { replicateQueryRecordsetAsView } from '@cityssm/mssql-query-replicate'\n\nconst result = await replicateQueryRecordsetAsView(\n  {\n    sourceType: 'sql',\n    sourceSql: `SELECT w.workOrderNumber,\n        w.workOrderDate,\n        w.workOrderDescription, s.workOrderStatus\n      FROM WorkOrders w\n      LEFT JOIN WorkOrderStatuses s\n        ON w.workOrderStatusId = s.workOrderStatusId\n      WHERE year(w.workOrderDate) = @yearParameter`,\n    sourceParameters: {\n      yearParameter: new Date().getFullYear()\n    },\n    sourceDatabase: {\n      server: 'productionServer',\n      user: 'user',\n      password: 'p@ssword',\n      database: 'WorkOrderSystem'\n    }\n  },\n  {\n    destinationViewName: 'WorkOrdersThisYear',\n    destinationDatabase: {\n      server: 'devServer',\n      user: 'devUser',\n      password: 'passw0rd',\n      database: 'TestDB'\n    },\n    dropOldTables: true\n  }\n)\n\nconsole.log(result)\n\n/*\n  {\n    success: true,\n    destinationRows: 1337,\n    destinationTableName: '_WorkOrdersThisYear_1729614386783'\n  }\n */\n```\n\n## Related Projects\n\n[@cityssm/mssql-multi-pool](https://www.npmjs.com/package/@cityssm/mssql-multi-pool)\u003cbr /\u003e\nA simple way to manage connections to multiple SQL Server databases using the Node.js Tedious package ([node-mssql](https://www.npmjs.com/package/mssql)).\n\n[@cityssm/mssql-system-catalog](https://www.npmjs.com/package/@cityssm/mssql-system-catalog)\u003cbr /\u003e\nHelper functions to query a SQL Server database's system catalog.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcityssm%2Fnode-mssql-query-replicate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcityssm%2Fnode-mssql-query-replicate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcityssm%2Fnode-mssql-query-replicate/lists"}