Last active
February 5, 2019 17:04
-
-
Save ConstantineK/4e8cddab9130138e2ab3219bc0955c70 to your computer and use it in GitHub Desktop.
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 * | |
FROM | |
( | |
SELECT | |
STUFF(( | |
SELECT '' + comp.entity_data AS [text()] | |
FROM ( | |
SELECT | |
DISTINCT | |
number | |
FROM master..spt_values AS v | |
WHERE | |
v.number BETWEEN 1 and LEN(o.name) | |
) AS num | |
CROSS APPLY | |
( | |
SELECT | |
SUBSTRING(o.name, num.number, 1) AS entity_data | |
) AS comp | |
WHERE | |
comp.entity_data IN | |
( | |
'0', | |
'1', | |
'2', | |
'3', | |
'4', | |
'5', | |
'6', | |
'7', | |
'8', | |
'9' | |
) | |
FOR XML PATH('') ), 1, 0, '' ) AS res, | |
o.object_id | |
FROM sys.objects AS o | |
) AS f | |
WHERE | |
f.res IS NOT NULL | |
SELECT name, object_id | |
FROM sys.objects | |
where name like '%[0-9]%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment