2

Before you ask, I'm not trying to hack anywhere, just debugging a faulty application for issues that support doesn't cover.

I have a MDF file from SQL Server 2012 where a limited-rights user was created. I have installed another copy of SQL Server and attached the original database, and added some membership roles to the existing user. Re-importing the MDF in the original SQL Server seems to work as now I can see at least the table objects. I'm having some troubles managing the roles though.

My goal is to be able to execute this SQL query https://stackoverflow.com/a/945290/7008500

Considering I only have access to the MDF files, is it actually feasible?

Thank you.

Community
  • 1
  • 1
tsmr
  • 198
  • 11
  • If you control the SQL Server the database was attached to, you should be sysadmin. Meaning, you can do anything you damn well please. At the very least, you need `VIEW SERVER STATE` permission to execute the query you linked to, and this is not related to the database rights. (Also note that the query you linked to identifies costly queries based on *actual workload* -- if you're not running any applications on your new server, there won't be any workload. This must be executed on an actual production server.) – Jeroen Mostert Nov 23 '16 at 13:18

0 Answers0