Impersonate
SetImpersonate
DelImpersonate
example:
select dbo.[SetImpersonate]('domain','user','pass') select * from dbo.FindFiles('\\192.168.1.100\path','',1)
so, imagine you are on a Sql server and you need to access to same external path of it.
usually you can only access to the share where your account or sql service are allowed.
with this function you can force the account to use to access to the share.
[SetImpersonate] use the same logic of [SetParameterMem], in fact if you will try:
select * from dbo.GetParametersMem('')
you will have
cid | spid | par | val | date_modify |
---|---|---|---|---|
f8908399-0cac-4e4e-a479-7940044708a9 | 56 | *domain | domain | 08/08/2017 10:30:57 |
f8908399-0cac-4e4e-a479-7940044708a9 | 56 | *user | user | 08/08/2017 10:30:57 |
f8908399-0cac-4e4e-a479-7940044708a9 | 56 | *pass | pass | 08/08/2017 10:30:57 |
if you want to remove the impersonate just exec:
select dbo.DelImpersonate()