Forum Discussion

AndriiZhytariuk's avatar
AndriiZhytariuk
New Member
10 months ago
Solved

Check is Fabric

How to check if the instance you connected to is a fabric using sql query ?

  • AndriiZhytariuk When you use SELECT @@VERSION you get the following result "Microsoft SQL Azure (RTM) - 12.0.2000.8 ↵ Aug 26 2025 08:30:18 ↵ Copyright (C) 2025 Microsoft Corporation". You notice that the database is just a native Azure SQL database.

     

    Using EXEC sp_server_info will also not show that the SQL Database is created by Fabric.

     

    But mayb you can use SELECT DB_NAME(). This will show the real database name, which has a GUID postfix in the name. The name might be something like my_database-62f529f5-a1c4-4686-948d-20bcd558290a.

    If this a good enough, you can use the function below to check for a GUID postfix.

     

    CREATE FUNCTION dbo.IsFabricDatabase()
    RETURNS BIT
    AS
    BEGIN
        DECLARE @possibleGuid VARCHAR(36) = RIGHT(DB_NAME(), 36);
    
        IF TRY_CAST(@possibleGuid AS UNIQUEIDENTIFIER) IS NOT NULL
            RETURN 1;
        ELSE
            RETURN 0;
    END

     Hope this helps. If so, please give a Kudos 👍 and mark as Accepted Solution ✔️.

  • Hi AndriiZhytariuk,

    Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to nielsvdcsuparnababu8,  for those inputs on this thread.

    Check in Fabric UI: In your Fabric workspace, select the item (Warehouse or Lakehouse). The top-right pane will show the SQL endpoint name, which typically follows this pattern:

    <yourwarehouse>.sql.fabric.microsoft.com

    Check using SQL query:

    SELECT @@VERSION;

    This will return details about the SQL engine. If you see “Microsoft Fabric” or “Synapse Data Warehouse in Microsoft Fabric” in the output, that means you’re connected to a Fabric SQL endpoint.

    Note: Fabric SQL endpoints are always cloud-based and do not support on-premises connections.

    If you can share which environment you are connecting from (Fabric Warehouse, Lakehouse SQL endpoint, or Azure SQL DB), we will be help further.

    Thank you.

5 Replies

  • Hi AndriiZhytariuk 

     

    There is no direct way to get instance, we conencted by using SQL query method in Fabric. You can run a command to get SQL engine version. SELECT @@VERSION; if you run this u will get like below

     

     

    I hope this helps you.

     

    Thank you!!

     

    Did I answer your question? Mark my post as a solution!

    Proud to be a Super User!

     

  • AndriiZhytariuk When you use SELECT @@VERSION you get the following result "Microsoft SQL Azure (RTM) - 12.0.2000.8 ↵ Aug 26 2025 08:30:18 ↵ Copyright (C) 2025 Microsoft Corporation". You notice that the database is just a native Azure SQL database.

     

    Using EXEC sp_server_info will also not show that the SQL Database is created by Fabric.

     

    But mayb you can use SELECT DB_NAME(). This will show the real database name, which has a GUID postfix in the name. The name might be something like my_database-62f529f5-a1c4-4686-948d-20bcd558290a.

    If this a good enough, you can use the function below to check for a GUID postfix.

     

    CREATE FUNCTION dbo.IsFabricDatabase()
    RETURNS BIT
    AS
    BEGIN
        DECLARE @possibleGuid VARCHAR(36) = RIGHT(DB_NAME(), 36);
    
        IF TRY_CAST(@possibleGuid AS UNIQUEIDENTIFIER) IS NOT NULL
            RETURN 1;
        ELSE
            RETURN 0;
    END

     Hope this helps. If so, please give a Kudos 👍 and mark as Accepted Solution ✔️.

  • Hi AndriiZhytariuk,

    Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to nielsvdcsuparnababu8,  for those inputs on this thread.

    Check in Fabric UI: In your Fabric workspace, select the item (Warehouse or Lakehouse). The top-right pane will show the SQL endpoint name, which typically follows this pattern:

    <yourwarehouse>.sql.fabric.microsoft.com

    Check using SQL query:

    SELECT @@VERSION;

    This will return details about the SQL engine. If you see “Microsoft Fabric” or “Synapse Data Warehouse in Microsoft Fabric” in the output, that means you’re connected to a Fabric SQL endpoint.

    Note: Fabric SQL endpoints are always cloud-based and do not support on-premises connections.

    If you can share which environment you are connecting from (Fabric Warehouse, Lakehouse SQL endpoint, or Azure SQL DB), we will be help further.

    Thank you.

    • v-kpoloju-msft's avatar
      v-kpoloju-msft
      Icon for Community Support rankCommunity Support

      Hi AndriiZhytariuk,

      Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.

      Thank you.

      • v-kpoloju-msft's avatar
        v-kpoloju-msft
        Icon for Community Support rankCommunity Support

        Hi AndriiZhytariuk,

        Just wanted to follow up. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

        Thank you.