Is there a SQL function to translate labels?

Hi. I’m wondering if there’s a simple way to obtain the text value of a label directly in the Dynamics AX database?
For example, convert this: "@SYS323369" to this: "System user"

labels are stored in the table, you can write a select statement on SysModelElementLabel table. It has label id and related text in required language.

No example to share?

SELECT Text
FROM [YourModelDataBase].[dbo].[SYSMODELELEMENTLABEL] as labels
WHERE labels.LABELID = ‘@SYS323369’ AND
labels.LANGUAGE = ‘en_us’

Another example,

SELECT Text
FROM [YourModelDataBase].[dbo].[ModelElementLabel]
where Language = ‘en_us’ AND
CONCAT(’@’, Module, LabelId) = ‘@SYS323369

This is what I’m looking for!
Really appreciate it!

CREATE FUNCTION [YOURSCHEMA].[AXLabel2Text](@labelId AS varchar(255))
RETURNS varchar(255)
AS
BEGIN
DECLARE @ret AS varchar(255);
IF (LEFT(@labelId, 1) = ‘@’)
SELECT @ret = Text
FROM [dbo].[SYSMODELELEMENTLABEL] as labels
WHERE labels.LABELID = @labelId AND labels.LANGUAGE = ‘en_us’;
ELSE
SET @ret = @labelId;
RETURN @ret;
END