{"id":15003166,"url":"https://github.com/tomaztk/sqlserver-data-lineage","last_synced_at":"2025-10-30T09:31:28.358Z","repository":{"id":53118466,"uuid":"325737522","full_name":"tomaztk/SQLServer-Data-Lineage","owner":"tomaztk","description":"Data Lineage for Microsoft SQL Server, Azure SQL Server and Azure Synapse","archived":false,"fork":false,"pushed_at":"2022-09-15T11:36:52.000Z","size":89,"stargazers_count":18,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-02T07:51:14.258Z","etag":null,"topics":["azure-sql-database","azure-synapse","data-lineage","microsoft-sql-server","remove","remove-comments","sql","sql-server","sql-server-database","t-sql"],"latest_commit_sha":null,"homepage":"","language":"TSQL","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/tomaztk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"tomazkastrun"}},"created_at":"2020-12-31T07:00:40.000Z","updated_at":"2025-01-13T03:53:25.000Z","dependencies_parsed_at":"2023-01-18T08:35:12.655Z","dependency_job_id":null,"html_url":"https://github.com/tomaztk/SQLServer-Data-Lineage","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FSQLServer-Data-Lineage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FSQLServer-Data-Lineage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FSQLServer-Data-Lineage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaztk%2FSQLServer-Data-Lineage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomaztk","download_url":"https://codeload.github.com/tomaztk/SQLServer-Data-Lineage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238950485,"owners_count":19557533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["azure-sql-database","azure-synapse","data-lineage","microsoft-sql-server","remove","remove-comments","sql","sql-server","sql-server-database","t-sql"],"created_at":"2024-09-24T18:56:30.270Z","updated_at":"2025-10-30T09:31:28.024Z","avatar_url":"https://github.com/tomaztk.png","language":"TSQL","readme":"# Data Lineage for Microsoft T-SQL Queries \n\nData Lineage Transact SQL (T-SQL) for [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server) or [Azure SQL Server](https://azure.microsoft.com/en-us/services/sql-database/campaign/) enables you to find the data origins and data destinations in your query. It gives you the visibility over query data columns and ability to track the changes over time.\n\n\n# Features\n\n* Remove any kind of comments from your T-SQL code\n* Remove any special characters from your T-SQL code\n* Generate data lineage from your T-SQL Code\n* Learn interesting facts about your data and get better analytics\n\n\n\n# Removing comments from your T-SQL code\nClean your code of in-line and multiple lines of _--comments_ or _slash star_ comments from better visibility and greater readability.\n\n\u003ca href=\"https://tomaztsql.files.wordpress.com/2021/07/2021-07-13-05_24_06-window.png\"\u003e\u003cimg width=\"50%\" src=\"https://tomaztsql.files.wordpress.com/2021/07/2021-07-13-05_24_06-window.png\"/\u003e\n\u003c/a\u003e\n  \nRun **Remove_comments.sql**  to create  a procedure. \nStrip and remove all comments from your T-SQL query by using _dbo.remove_comments_ procedure \n\n``` sql\n--  Run procedure dbo.remove_comments\n\nEXEC dbo.remove_comments\n   @procedure_name = N'dbo.MySample_procedure'\n\n```\n\n\n# Start with Data Lineage on T-SQL\n\nRun **TSQL_data_lineage.sql**  file to create  a lineage procedure. This script includes the removal of comments and special characters and creates the data lineage.\n\n\n```sql\n-- Get your query:\nDECLARE @test_query VARCHAR(MAX) = '\n\n-- This is a sample query to test data lineage\nSELECT \n    s.[BusinessEntityID]\n    ,p.[Title]\n    ,p.[FirstName]\n    ,p.[MiddleName]\n   -- ,p.[LastName]\n    ,p.[Suffix]\n    ,e.[JobTitle] as JobName\n    ,p.[EmailPromotion]\n    ,s.[SalesQuota]\n    ,s.[SalesYTD]\n    ,s.[SalesLastYear]\n\t,( SELECT GETDATE() ) AS DateNow\n\t,( select count(*)  FROM [AdventureWorks2014].sales.[SalesPerson] ) as totalSales\n\n/*\n\nAdding some comments!\n\n*/\n\nFROM [AdventureWorks2014].sales.[SalesPerson] s\n    LEFT JOIN [AdventureWorks2014].[HumanResources].[Employee] e \n    ON e.[BusinessEntityID] = s.[BusinessEntityID]\n\tINNER JOIN [AdventureWorks2014].[Person].[Person] AS p\n\tON p.[BusinessEntityID] = s.[BusinessEntityID]\n\n'\n\n-- And run the procedure with single input parameter\nEXEC dbo.TSQL_data_lineage \n  @InputQuery = @test_query\n```\n\n# Requirements\n\nThe script works with any of the following versions:\n\n* Microsoft SQL Server database (works on all editions and versions 2016+) \n* Azure SQL Database \n* Azure SQL Server \n* Azure SQL MI \n\n\n\nGet started\n===========\nThe easiest way to get started is with fork or clone the repository.\n\n\n## Cloning the repository\nYou can follow the steps below to clone the repository.\n```\ngit clone https://github.com/tomaztk/SQLServer-Data-Lineage.git\n```\n\n## Read more on blog posts\n\nRemove comments from your T-SQL code ([Blog post](https://tomaztsql.wordpress.com/2021/07/13/remove-comments-from-your-t-sql-code/))\n\n\n## Collaboration and contributors\nIdeas, code collaboration or any other contributions of any kind is highly appreciated! \nFork the repository, add your code.\n\n","funding_links":["https://ko-fi.com/tomazkastrun"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaztk%2Fsqlserver-data-lineage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomaztk%2Fsqlserver-data-lineage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaztk%2Fsqlserver-data-lineage/lists"}