I've used the technique in this question to impersonate the Windows User who has admin rights over a database. I thought that this would allow the process to alter tables etc (which if I'm logged on as that person I'm able to). My connection string uses IntegratedSecurity
and after I prompt the user for db admin username & password I impersonate that user and then reconnect to the database. I thought this would allow me to create tables etc, but no ...
Is there something else I need to do to give my program (temporary) admin rights to my database?
I've tried following the impersonation with EXECUTE AS LOGIN = @user
, but it wasn't happy - do I need to supply a password to SQL as well to make that work, perhaps?