Impersonation Sample  Updated: 5 December 2005 The Impersonation
sample demonstrates how to use impersonation to use the
credentials passed from the client to access operating system
protected resources, such as files, when you are using
integrated security. By default, the credentials of the account
that SQL Server runs under are used when you access these kinds
of resources.  This form of impersonation does not affect access
to SQL Server protected resources such as tables, unless you are
performing the data access to another database server (SQL
Server or some other type of database server) via ADO.NET. In
that case you should use impersonation during the execution of
the Open method on the connection in order to pass the client's
credentials to the remote server. Impersonation during the other
ADO.NET calls are not necessary.  This sample also demonstrates
how to access information about files that are contained in a
directory using a common language runtime (CLR) table valued
function. Install directory: