Skip to content

Instantly share code, notes, and snippets.

@DanielLoth
Created April 11, 2019 05:50
Show Gist options
  • Select an option

  • Save DanielLoth/8317bb17eae8dfae4a94189186dad95f to your computer and use it in GitHub Desktop.

Select an option

Save DanielLoth/8317bb17eae8dfae4a94189186dad95f to your computer and use it in GitHub Desktop.
Get SQL object code
--select text from Payroll.sys.syscomments where id = 55086;
select * from sys.sql_modules where [object_id] = 55086;
select value from STRING_SPLIT(
(select [definition] from Payroll.sys.sql_modules where [object_id] = 55086), char(10));
select value from STRING_SPLIT(
(select replace([definition], char(13), '') from Payroll.sys.sql_modules where [object_id] = 55086), char(10));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment