web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2012 Forms and .NET Business Connector Produce Error with SQL Server 2012 because of Deprecated FASTFIRSTROW Hint

(0) ShareShare
ReportReport
Posted on by 849

Our application logs into AX2012 using business connector. I have upgraded from SQL Server 2008 R2 to SQL Server 2012. We have applied the hotfix 2680186 for AX2012 compatibility with SQL Server 2012.

The application fails when trying to login to AX using business connector. This is the error encountered:

 

Cannot select a record in Application Model (UtilElements).

The SQL database has issued an error.

SQL error description: [Microsoft][SQL Server Native Client 10.0][SQL

Server]"FASTFIRSTROW" is not a recognized table hints option. If it is intended as a parameter to a table-valued function or to the CHANGETABLE function, ensure that

your database compatibility mode is set to 90.

SQL statement: SELECT T1.NAME,T1.RECORDTYPE,T1.PARENTID,T1.UTILLEVEL,101090 FROM UTILELEMENTS T1 WHERE ((RECORDTYPE=?)

AND (NAME=?)) OPTION(FAST 20)

 

I cannot modify the view in my application. Furthermore, these are in AX tables, which we are not allowed to modify on customer end. What is the workaround to login to AX? The AX forms error out too with the same error.

*This post is locked for comments

I have the same question (0)
  • neptolemos Profile Picture
    5 on at
    RE: AX 2012 Forms and .NET Business Connector Produce Error with SQL Server 2012 because of Deprecated FASTFIRSTROW Hint

    This worked for me!

    Thank you,

    -Steve

  • Community Member Profile Picture
    on at
    RE: AX 2012 Forms and .NET Business Connector Produce Error with SQL Server 2012 because of Deprecated FASTFIRSTROW Hint

    Hello Manish,

    If the AXUtil schema didn't work, try this...

    Open SQL server management studio,

    Select the AX database from the database list and Create a new query (Ctrl+N)

    then copy past the following code in the Query window, and Execute the query.

    -------------------------------------------

    ALTER VIEW [dbo].[UTILELEMENTS] AS

    SELECT -- Select all Root Elements or Id based children or Root Elements with no children

    d.[LayerId] AS UTILLEVEL,

    e.[ElementType] AS RECORDTYPE,

    e.[ParentId] AS PARENTID,

    e.[Name] AS NAME,

    cs.[SourceText] AS SOURCE,

    cast(NULL AS varbinary(max)) AS CODE,

    d.[BASEVERSION],

    d.[VERSION],

    d.[SAVECOUNT],

    d.[MODIFIEDDATETIME],

    0 AS DEL_MODIFIEDTIME,

    d.[MODIFIEDBY],

    d.[CREATEDDATETIME],

    0 AS DEL_CREATEDTIME,

    d.[CREATEDBY],

    d.ElementVersion AS RECVERSION,

    d.[LayerId] * cast(268435456 as bigint) + e.[ElementHandle] AS RECID

    FROM [dbo].[ModelElement] AS e WITH (READUNCOMMITTED)

    INNER JOIN [dbo].[ModelElementData] AS d WITH (READUNCOMMITTED)

    ON d.ElementHandle = e.ElementHandle

    LEFT OUTER JOIN [dbo].[Sources] AS cs WITH (READUNCOMMITTED)

    ON cs.SourceHandle = e.ElementHandle

    AND cs.LayerId = d.LayerId

    WHERE

    e.ParentHandle = 0 -- Only Root element

    AND NOT EXISTS

    (SELECT 1 FROM [dbo].[ModelElement] AS gc WITH (READUNCOMMITTED)

    WHERE gc.ParentHandle = e.ElementHandle AND gc.ParentId = 0)

    OR (e.ParentHandle <> 0 AND e.ParentId <> 0) -- Or Not granular child

    UNION ALL

    SELECT -- Select all Granular Root Elements children

    ug.[LayerId] AS UTILLEVEL, -- dgc = Distinct Granular Child Layers

    e.[ElementType] AS RECORDTYPE,

    e.[ParentId] AS PARENTID,

    e.[Name] AS NAME,

    cs.[SourceText] AS SOURCE,

    cast(NULL AS varbinary(max)) AS CODE,

    d.[BASEVERSION],

    d.[VERSION],

    d.[SAVECOUNT],

    d.[MODIFIEDDATETIME],

    0 AS DEL_MODIFIEDTIME,

    d.[MODIFIEDBY],

    d.[CREATEDDATETIME],

    0 AS DEL_CREATEDTIME,

    d.[CREATEDBY],

    d.ElementVersion AS RECVERSION,

    d.[LayerId] * cast(268435456 as bigint) + e.[ElementHandle] AS RECID

    FROM [dbo].[ModelElement] AS e WITH (READUNCOMMITTED)

    INNER JOIN [dbo].[UtilGranularLayers] AS ug WITH (READUNCOMMITTED) ON ug.RootHandle = e.ElementHandle

    INNER JOIN [dbo].[ModelElementData] AS d WITH (READUNCOMMITTED) ON d.ElementHandle = e.ElementHandle

    LEFT OUTER JOIN [dbo].[Sources] AS cs WITH (READUNCOMMITTED)

    ON cs.SourceHandle = e.ElementHandle

    AND cs.LayerId = d.LayerId

    WHERE

    e.ParentHandle = 0 -- Only Root element

    AND EXISTS

    (SELECT 1 FROM [dbo].ModelElement AS gc WITH (READUNCOMMITTED)

    WHERE gc.ParentHandle = e.ElementHandle AND gc.ParentId = 0) -- Granular child

    ---------------------------------

    ALTER VIEW [dbo].[UTILIDELEMENTS] AS

    SELECT -- Select all Root Elements or Id based children or Root Elements with no children

    d.[LayerId] AS UTILLEVEL,

    e.[ElementType] AS RECORDTYPE,

    e.[ParentId] AS PARENTID,

    e.[Name] AS NAME,

    e.[AxId] AS ID,

    cs.[SourceText] AS SOURCE,

    cast(NULL AS varbinary(max)) AS CODE,

    d.[BASEVERSION],

    d.[VERSION],

    d.[SAVECOUNT],

    d.[MODIFIEDDATETIME],

    0 AS DEL_MODIFIEDTIME,

    d.[MODIFIEDBY],

    d.[CREATEDDATETIME],

    0 AS DEL_CREATEDTIME,

    d.[CREATEDBY],

    d.ElementVersion AS RECVERSION,

    d.[LayerId] * cast(268435456 as bigint) + e.[ElementHandle] AS RECID

    FROM [dbo].[ModelElement] AS e WITH (READUNCOMMITTED)

    INNER JOIN [dbo].[ModelElementData] AS d WITH (READUNCOMMITTED)

    ON d.ElementHandle = e.ElementHandle

    LEFT OUTER JOIN [dbo].[Sources] AS cs WITH (READUNCOMMITTED)

    ON cs.SourceHandle = e.ElementHandle

    AND cs.LayerId = d.LayerId

    WHERE

    e.ParentHandle = 0 -- Only Root element

    AND NOT EXISTS

    (SELECT 1 FROM [dbo].[ModelElement] AS gc WITH (READUNCOMMITTED)

    WHERE gc.ParentHandle = e.ElementHandle AND gc.ParentId = 0)

    OR (e.ParentHandle <> 0 AND e.ParentId <> 0) -- Or Not granular child

    UNION ALL

    SELECT -- Select all Granular Root Elements children

    ug.[LayerId] AS UTILLEVEL, -- dgc = Distinct Granular Child Layers

    e.[ElementType] AS RECORDTYPE,

    e.[ParentId] AS PARENTID,

    e.[Name] AS NAME,

    e.[AxId] AS ID,

    cs.[SourceText] AS SOURCE,

    cast(NULL AS varbinary(max)) AS CODE,

    d.[BASEVERSION],

    d.[VERSION],

    d.[SAVECOUNT],

    d.[MODIFIEDDATETIME],

    0 AS DEL_MODIFIEDTIME,

    d.[MODIFIEDBY],

    d.[CREATEDDATETIME],

    0 AS DEL_CREATEDTIME,

    d.[CREATEDBY],

    d.ElementVersion AS RECVERSION,

    d.[LayerId] * cast(268435456 as bigint) + e.[ElementHandle] AS RECID

    FROM [dbo].[ModelElement] AS e WITH (READUNCOMMITTED)

    INNER JOIN [dbo].[UtilGranularLayers] AS ug WITH (READUNCOMMITTED) ON ug.RootHandle = e.ElementHandle

    INNER JOIN [dbo].[ModelElementData] AS d WITH (READUNCOMMITTED) ON d.ElementHandle = e.ElementHandle

    LEFT OUTER JOIN [dbo].[Sources] AS cs WITH (READUNCOMMITTED)

    ON cs.SourceHandle = e.ElementHandle

    AND cs.LayerId = d.LayerId

    WHERE

    e.ParentHandle = 0 -- Only Root element

    AND EXISTS

    (SELECT 1 FROM [dbo].ModelElement AS gc WITH (READUNCOMMITTED)

    WHERE gc.ParentHandle = e.ElementHandle AND gc.ParentId = 0) -- Granular child

    ------------

  • Community Member Profile Picture
    on at
    Re: AX 2012 Forms and .NET Business Connector Produce Error with SQL Server 2012 because of Deprecated FASTFIRSTROW Hint

    Hi Todd and others - The 'AXUtil schema' didn't work for me in the command prompt? Are there other solutions to this other that anyone has succeeded getting past? Please advise. Thanks,

  • Verified answer
    Todd Pierpoint Profile Picture
    849 on at
    Re: AX 2012 Forms and .NET Business Connector Produce Error with SQL Server 2012 because of Deprecated FASTFIRSTROW Hint

    The issue here is “"FASTFIRSTROW" is not a recognized table hints option”.  

    Microsoft is making this more clear in their documentation but the short version is you need to run the following command in Microsoft Dynamics AX 2012 Management Shell

    -----

    Axutil schema

    -----

    This will go through and update your schema and correct the FASTFIRSTROW hint.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans