Hi,
recently i needed to query a table , however i was denied "Select " permissions (because permissions had not yet been exported as the db was).
Should my application enable for administrator to grant permissions , if that error occurs OR should permission granting be done through MS SQL server only?
(is it unnecessary,security risk or good practice?)

-Thanks :icon_mrgreen:

It depends. If your application installs the SQL Server instance and maintains it then you can do what you need to ensure the application functions.

If you allow users to use any network instance of SQL then you're best off not to automate any security modifications as you risk pissing off a DBA.

I have both cases -- In the case where my app installs the DB I require the app to run with dbo permissions so it can adjust the database accordingly -- both schema and permissions.

In the case where I don't install the DB I don't make any changes, I just flash informative error messages with what they need to do to fix the problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.