Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Dynamics GP Script

Posted on by Microsoft Employee

Hi, i don't see the below script inside my Dynamics GP application folder. Can anyone help me on how can i retrieve the below scripts?

Reindex.sql
Updatsta.sql
Recomp.sql

I have browsed to C:\Program Files\Microsoft Dynamics\GP\SQL\Utility\. But i only found the most similar path is C:\Program Files\Microsoft Dynamics\GP\SQL\Util\

And there is no 0 folder inside UTIL folder. The 0 folder only found outside of UTIL folder and it does not contain the above mentioned scripts.

THank you.

*This post is locked for comments

  • Suggested answer
    L Vail Profile Picture
    L Vail 65,271 on at
    Re: Dynamics GP Script

    I found this in this history:

    Posted by Ian Stewart replied on 01-18-2010 3:32 AM  

    Copy and paste the below into a query window and 'save as' into the utilities folder.

    Recomp.sql

    /*Count : 2 */

    /*Begin_Recompile*/

    declare @cStatement varchar(255)

    declare T_cursor CURSOR for select 'sp_recompile [' + convert(varchar(64),name) + ']' from sysobjects where type = 'U' and uid = 1

    set nocount on

    OPEN T_cursor

    FETCH NEXT FROM T_cursor INTO @cStatement

    WHILE (@@FETCH_STATUS <> -1)

    begin

    EXEC (@cStatement)

    FETCH NEXT FROM T_cursor INTO @cStatement

    end

    DEALLOCATE T_cursor

    /*End_Recompile*/

    /*Begin_UpdateStats*/

    declare @cStats varchar(255)

    declare T_cursor CURSOR for select 'update statistics [' + convert(varchar(64),name) + ']' from sysobjects where type = 'U' and uid = 1

    set nocount on

    OPEN T_cursor

    FETCH NEXT FROM T_cursor INTO @cStats

    WHILE (@@FETCH_STATUS <> -1)

    begin

    EXEC (@cStats)

    FETCH NEXT FROM T_cursor INTO @cStats

    end

    DEALLOCATE T_cursor

    /*End_UpdateStats*/

    Reindex.sql

    /*Count : 1 */

    declare @tablename char(255)

    DECLARE t_cursor CURSOR for

    select 'DBCC DBREINDEX([' + o.name + '], '''', 0)'

    from

    sysobjects o, syscolumns c

    where o.id = c.id and o.type = 'U' and c.name like '%DEX_ROW_ID%'

    set NOCOUNT on

    open t_cursor

    FETCH NEXT FROM t_cursor INTO @tablename

    while (@@fetch_status <> -1)

    begin

    if (@@fetch_status <> -2)

    begin

    exec (@tablename)

    end

    FETCH NEXT FROM t_cursor into @tablename

    end

    DEALLOCATE t_cursor

    Supplied as is - check against a test database first to ensure the above is complete and you are happy with the results.

    Kiind regards,

    Leslie

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans