The problem you most likely experiencing is Delegation
as opposed Impersonation
.
I assume in your production environment you actually have your Web Browser, your IIS Server and SQL Server are all on different machines.
Simple Impersonation does not support Multi-Hop
.
To support Multi-Hop
you need to setup Kerberos
with Delegation
. You are going to have to setup the SPN
records on your Active Directory
. Once that is done, you also need to enable Delgation
for the IIS machine on your AD.
In short, Delegation is a HUGE can of worms.