Data Lineage Transact SQL (T-SQL) for Microsoft SQL Server 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.
You can follow the steps below to clone the repository.
git clone https://github.com/tomaztk/SQLServer-Data-Lineage.git
Clean your code of in-line and multiple lines of --comments or slash star comments from better visibility and greater readability.
- Run the support files
Run helper_fun.sql helper file, that will create a sample data tables and example procedure. In addition, run a remove_comments.sql file to create a procedure with stripping and removing all the comments from your T-SQL query.
- Removing comments from T-SQL Query
Strip and remove all comments from your T-SQL query by using dbo.remove_comments procedure.
# Run procedure dbo.remove_comments
EXEC dbo.remove_comments
@procedure_name = N'sql_sample_procedure'
- Clone the repository
- Have your T-SQL query ready
- Load the DataLineage table function with your query
# Run
DECLARE @t_sql_query NVARCHAR(MAX)
SET @t_sql_query = N'-- Query
SELECT top 10
[name]
,object_id
--,principal_id
--,schema_did
,schema_id
from sys.tables'
SELECT dbo.fn_datalineage(@t_sql_query)Remove comments from your T-SQL code (Blog post)
Ideas, code collaboration or any other contributions of any kind is highly appreciated! Fork the repository, add your code.
Write the following formula $\sqrt{3x-1}+(1+x)^2$ and it will be rendered as: