Read about:
OBJECT_ID[
^] and
OBJECT_NAME[
^]
Example:
DECLARE @dbid INT
DECLARE @tbid INT
SET @dbid = DB_ID(N'A_TEST')
SET @tbid = OBJECT_ID(N'Table_1', N'U')
SELECT @dbid AS [DatabaseID], DB_NAME(@dbid) AS [DatabaseName],@tbid AS [TableID], OBJECT_NAME(@tbid) AS [TableName]