0

Is it possible to limit the resources used NOT with Resource Governor, but with the C# connection statement, or the query itself.

It would be nice to control resources at runtime.

All web searches/ documention I have found so far points me to the Resource Governor.

But I would like to be more dynamic.

ManInMoon
  • 6,795
  • 15
  • 70
  • 133
  • 1
    If you want to limit resources, improve the queries. Resources *are* controlled at runtime - by the DBA through the Resource Governor. The DBA knows what his/her system is doing, how much data there is, what takes priority and what not. – Panagiotis Kanavos Mar 19 '19 at 11:17
  • there are a couple of query hints `max_grant_percent` and `maxdop` that can limit resources in quite a blunt way. But if you memory starve an inefficient query and it spills to disc that may still adversely affect the system as a whole – Martin Smith Mar 19 '19 at 11:20
  • @MartinSmith I am having trouble finding an example of c# code that shows usage of max_grant-percent. Can you give me a link please – ManInMoon Mar 19 '19 at 11:34
  • It's a query hint so nothing to do with C#. It is added to the SQL you are executing – Martin Smith Mar 19 '19 at 11:34
  • The only way is to have different credentials on SQL Server to limit access. You can have a user credential and then an Admin credential where the Admin has greater access to the database. – jdweng Mar 19 '19 at 11:45

0 Answers0