Last active
December 6, 2021 00:46
-
-
Save naradae/cd8cec030cf1db9b8d64bd5a0cb64907 to your computer and use it in GitHub Desktop.
SQL Metadata Queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select [App ID], Name, Publisher | |
from [NAV App Installed App] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
- Update the LIKE expression to wild card search for specific tables | |
*/ | |
SELECT app.Name as [App Name], app.Publisher as [App Publisher], t.name as [Table Name], c.name as [Column Name], ty.name as [Type], c.max_length as [Max Length] | |
FROM sys.tables t | |
INNER JOIN sys.columns c ON c.object_id = t.object_id | |
INNER JOIN sys.types ty ON ty.user_type_id = c.user_type_id | |
INNER JOIN [NAV App Installed App] app | |
ON app.[App ID] = RIGHT(t.name, 36) | |
WHERE t.name LIKE 'Cronus%Sales Line%' | |
AND t.name LIKE REPLACE('%00000000-0000-0000-0000-000000000000', '0', '[0-9a-fA-F]') | |
ORDER BY t.name, c.column_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
- Update the LIKE expression to wild card search for specific tables | |
*/ | |
SELECT app.Name as [App Name], app.Publisher as [App Publisher], t.name as [Table Name] | |
FROM sys.tables t | |
INNER JOIN [NAV App Installed App] app | |
ON app.[App ID] = RIGHT(t.name, 36) | |
WHERE t.name LIKE '%Sales Line%' | |
AND t.name LIKE REPLACE('%00000000-0000-0000-0000-000000000000', '0', '[0-9a-fA-F]') | |
ORDER BY t.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
- Update the LIKE expression to wild card search for specific tables | |
*/ | |
SELECT name | |
FROM sys.tables | |
WHERE name LIKE '%Sales Line%' | |
ORDER BY name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment