web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • L Vail Profile Picture
    65,271 on at

    Why not just use the TableSetCreateMode=True

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

    Kind regards,

    Leslie

  • k@vi Profile Picture
    430 on at

    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
    65,271 on at

    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
    430 on at

    Thanks L Vail,

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

  • KarthikMurugan Profile Picture
    71 on at

    Hi, How you did this concept please share.

  • Bill Campbell Profile Picture
    12 on at

    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.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans