Skip to content

Instantly share code, notes, and snippets.

@matejskubic
Created May 27, 2013 12:26
Show Gist options
  • Save matejskubic/5656814 to your computer and use it in GitHub Desktop.
Save matejskubic/5656814 to your computer and use it in GitHub Desktop.
Search AX model database for source code
SELECT TOP 10
root.Name RootElemnetName
, me.Name ElementName
, et.ElementTypeName
, CAST([SourceText] AS nvarchar(MAX)) SourceText
, me.RootHandle
, me.ElementHandle
FROM [dbo].[Sources] s
JOIN ModelElement me ON s.SourceHandle=me.ElementHandle
JOIN ModelElement root on root.ElementHandle=me.RootHandle
JOIN ElementTypes et ON et.ElementType=me.ElementType
WHERE CAST([SourceText] AS nvarchar(MAX)) like '%amountOrderedNotInvoiced%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment