You may use the like operator to see whether the specified Id contained in the ID column. for e.g.
select * from <tablename> where ID like '%123'
One problem with this that you may get multiple records in the query, for eg, the above query will return all IDs ending with 123. To prevent this, instead of using the like clause, you can use the format method to format the ID to the neccessary string format and do an equal comparison. For. e.g.
select * from articles where Format(Id, '0000000') = '0000123'
Refer: https://learn.microsoft.com/en-us/sql/t-sql/functions/format-transact-sql?view=sql-server-ver16
hope this helps