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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Delete & re-create DYNSA

(0) ShareShare
ReportReport
Posted on by 3,795

I have transferred (backup/restore) SQL databases from one server to another SQL server.

However, I did not execute the SQL script to capture login, because I believe this is the reason why DYNSA having problem to grant a newly created GP user to any company. I have been trying many ways to resolve this problem, but still not successful. For example, make sure all databases ownership, giving DYNSA with fixed sysadmin SQL role...etc

And I am planning to delete the DYNSA in the GP and then re-create again. Kindly please advise, any risk?

Many thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi William, you can recreate DYNSA as follows:

    Open SQL Server Management Studio and navigate to 'Security'.
    Right-click 'logins' - select 'Add New' from the drop down list.
    In the Login Name field type 'DYNSA' and give it a password.
    Select the Server Roles tab and select both 'dbcreator' and 'securityadmin'.
    Select the User Mapping tab and first highlight DYNAMICS, then select database roles of 'db_owner' and
    'public'. Highlight all of the GP Company databases in turn and select the same two db roles for each.
    Click OK.
    Finally run the following script sp_changedbowner 'DYNSA' against all databases (DYNAMICS and GP company databases) to change the database ownership.

    Test by logging into GP as DYNSA. No real risk involved, your DYNSA user record doesn't work at the moment, the above should recreate it as if it was created by GP install.

  • William Kow Profile Picture
    3,795 on at

    Hi, Ian, thank you so much for your reply.

    BTW, may i know the User Mapping -- it is referring to the "Database Access" in SQL 2000 Enterprise Manager ?

    I cannot change ownership to DYNSA with the script, unless I delete DYNSA in respective company databases, then i can change database ownership to DYNSA.

    Msg 15110, Level 16, State 1, Line 1
    The proposed new database owner is already a user or aliased in the database.

    I would like to know whether DYNSA user account need to be exist in each company database Security > Users ?

    Many thanks in advance.

  • Community Member Profile Picture
    on at

    Hi William,

    In SQL 2008 the mapping is  Security >> Logins...

    • If you have deleted the DYNSA login and want to set it up - right Click and select 'New Login'.
    • or if it is already set up and you want to change its properties, right click the existing DYNSA login and select properties. This opens the Login Properties window.

    My post was based on you first deleting the DYNSA login. It looks like you are trying to set up a new DYNSA, while the old DYNSA is still there.

    Yes, the DYNSA needs to be set for each company database under 'User Mapping' in the 'Pages' section of the Login Properties window

    Best regards,

    Ian.

     

     

  • Community Member Profile Picture
    on at

    I am getting this same error.

    The proposed new database owner is already a user or aliased in the database.

    I have deleted the DYNSA and readded but I can't get the Owner to chance to DYNSA.  It is corrently SA

  • Suggested answer
    Oscar Mayer Profile Picture
    520 on at

    Using the following script, the DYNSA login will be recreated and configured as dbo for you.

    /****** Object: Login [DYNSA] Script Date: 02/04/2012 21:54:45 ******/

    IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'DYNSA')

    DROP LOGIN [DYNSA]

    GO

    /* For security reasons the login is created disabled and with a random password. */

    /****** Object: Login [DYNSA] Script Date: 02/04/2012 21:54:45 ******/

    CREATE LOGIN [DYNSA] WITH PASSWORD=N'= 5kG èÇ„CŽü"Ô °V¤%óug ÁÓ_·', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF

    GO

    EXEC sys.sp_addsrvrolemember @loginame = N'DYNSA', @rolename = N'securityadmin'

    GO

    EXEC sys.sp_addsrvrolemember @loginame = N'DYNSA', @rolename = N'dbcreator'

    GO

    ALTER LOGIN [DYNSA] ENABLE;

    GO

    USE master;

    GO

    ALTER AUTHORIZATION ON DATABASE::DYNAMICS TO DYNSA;

    GO

    USE DYNAMICS;

    GO

    DECLARE @interid VARCHAR(10);

    DECLARE @sqlstmt NVARCHAR(500);

    DECLARE c_company CURSOR FOR SELECT INTERID FROM SY01500;

    OPEN c_company;

    FETCH NEXT FROM c_company INTO @interid;

    WHILE @@FETCH_STATUS = 0

    BEGIN

    SET @sqlstmt = 'ALTER AUTHORIZATION ON DATABASE::' + RTRIM(@interid) + ' TO DYNSA';

    EXEC sp_executesql @sqlstmt;

    FETCH NEXT FROM c_company INTO @interid;

    END

    CLOSE c_company;

    DEALLOCATE c_company;

    GO

    /* End of script */

    Note: Reset the DYNSA password via Dynamics GP - User Setup window afterwards if desired.

  • rlmcvicar Profile Picture
    380 on at

    Using the above script, does not the random passward cause a problem. Can not it be set so it is know? Or Should it not be set to a known password?

  • Rennecia Barran Profile Picture
    on at

    I know this is an old post, but I had this issue today.

    What I did was - delete DYNSA user from Security within the database in SQL (Expand database, then expand security, then delete the DYNSA user).

    Then I was able to add DYNSA as the database owner via the script being run against the necessary database:

    sp_changedbowner 'DYNSA'

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans