@@LANGID is not supported in Microsoft SQL Azure (RTM) - 12.0.2000.8 (Azure Synapse) - most accurate way of determining the LANGID?

Adrian CB 0 Reputation points
2025-06-09T11:29:55.49+00:00

As per the title, according to https://learn.microsoft.com/en-us/sql/t-sql/functions/langid-transact-sql?view=sql-server-ver17&viewFallbackFrom=azure-sqldw-latest, LANGID is not supported in Azure Synapse.

What's the recommended (most accurate) way of determining the LANGID to fetch the date format?

I could use LANGUAGE, but it seems more error-prone. Is this the recommendation?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,357 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. J N S S Kasyap 3,300 Reputation points Microsoft External Staff Moderator
    2025-06-09T12:10:51.7666667+00:00

    Hi @Adrian CB
    @@LANGID isn’t supported in Azure Synapse, so if you need to determine the language or date format, the most reliable option is: 

    SELECT SESSIONPROPERTY('LANGUAGE') AS CurrentLanguage;
    
    

    This gives you the current session language (like us_english), which you can manually map to a LANGID if needed using the standard SQL Server language ID list. 

    If your goal is to understand the date format, run: 

    DBCC USEROPTIONS;
    
    

    Look for the dateformat row  it tells you whether the format is mdy, dmy, etc., which is what actually matters for parsing or formatting dates. 

    CultureInfo isn’t available inside Synapse SQL itself  it only applies in external tools like .NET or Power BI. So within Synapse, SESSIONPROPERTY('LANGUAGE') plus DBCC USEROPTIONS is your best bet. 

    I hope this information helps. Please do let us know if you have any further queries. 

     

    Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.


  2. Adrian CB 0 Reputation points
    2025-06-11T09:44:25.0666667+00:00

    It seems as if the only way is to rely on @@LANGUAGE.

    The answer is SELECT [dateformat] FROM [sys].[syslanguages] WHERE [name] = @@LANGUAGE

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.