Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Grant Permission on table in DYNAMIC database and TWO database.

(0) ShareShare
ReportReport
Posted on by 430

 

Using sa user I am crating table and am able give GRANT Options .But not for Non-sa user(Test user).
 
//Coding creating table in Dynamics database.
 string checkTable = String.Format("IF OBJECT_ID('{0}', 'U') IS NOT NULL SELECT 'true' ELSE SELECT 'false'", " ocgregistration");
 SqlCommand command = new SqlCommand( checkTable  , SQLConnection);
 
 bool exist Convert.ToBoolean(command.ExecuteScalar);
if (exist == false)
 {
    sql "create table ocgregistration(col1 varchar(150), col2 varchar(150), col3 varchar(150))";
    
cmd = new SqlCommand(sql,  SQLConnection );
    
cmd.ExecuteNonQuery();//Getting Error :Permission denied Creating table. 

    string 
Grant "GRANT SELECT,UPDATE,INSERT,DELETE,ALTER ON ocgregistration TO DYNGRP";
    
cmd = new SqlCommand(Grant,  SQLConnection );
    
cmd.ExecuteNonQuery();
}

I am getting same error message if I try to create a table in TWO database (Permission denied Creating table. )
Is there any other setting for non-sa user through sql server (and) c# code for creating table and GRANT option.

 

*This post is locked for comments

  • RE: Grant Permission on table in DYNAMIC database and TWO database.

    Bahulean - you are posting a one line comment on a post that is over 8 years old - I dont think you are going to get much from the community without more details.  So, if you have a real question, post in more detail and then the community might be able to assist.  Otherwise this will be consider a 'spam post' and will be removed.

  • KarthikMurugan Profile Picture
    KarthikMurugan 67 on at
    RE: Grant Permission on table in DYNAMIC database and TWO database.

    Hi, How you did this concept please share.

  • k@vi Profile Picture
    k@vi 430 on at
    Re: Grant Permission on table in DYNAMIC database and TWO database.

    Thanks L Vail,

    This is my  e -mail : bindelakavitha53@gmail.com

  • L Vail Profile Picture
    L Vail 65,271 on at
    Re: Grant Permission on table in DYNAMIC database and TWO database.

    KavithB

    TableSetCreateMode is a dexterity function. It's really easy to do; if you want I can walk you through it. Another bonus of creating it in Dex is that the table will automatically be part of the security model of Dynamics. Also, Report Writer could work with it.

    Kind regards,

    Leslie

    PS send me an e-mail if you are interested.

  • k@vi Profile Picture
    k@vi 430 on at
    Re: Grant Permission on table in DYNAMIC database and TWO database.

    Thanks for reply...I have to create the table using c# . Not directly on sql server.

    Let me  know how can we use TableSetCreateMode=True  in dynamic GP.

  • L Vail Profile Picture
    L Vail 65,271 on at
    Re: Grant Permission on table in DYNAMIC database and TWO database.

    Why not just use the TableSetCreateMode=True

    open the table and then run a stored proc to grant access?

    Kind 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans