Sql-server – linked server be made using the login’s current security context

sql server

Can I clarify this settings linked server be made using the login's current security context.
If I connect to serverA using windows account JOESmith and create the linked server using the above option to serverB.

What happen when BOBSmith connect to serverA and query serverB. does it use JOESmith credential or BOBSmith?

sorry if this sound's like a stupid question because "current security context" should imply it will use BOBSmith's account to serverB

But I just want to clarify

Best Answer

From BOL:

Be made using the login's current security context

Specify that a connection will be made using the current security context of the login for logins not defined in the list. If connected to the local server using Windows Authentication, your windows credentials will be used to connect to the remote server. If connected to the local server using SQL Server Authentication, login name and password will be used to connect to the remote server. In this case a login with the exact same name and password must exist on the remote server.

http://technet.microsoft.com/en-us/library/ms188477(v=sql.105).aspx

Using the login's current security context will use whatever user is logged in to the local machine. Be it Windows authentication or SQL authentication.

So, in your example above, if JOEsmith logs into server A and runs a query against server B, it will execute the query on server B using JOEsmith, as long as JOEsmith is a valid logon for server B.