question

Liam avatar image
Liam asked

Service Account & Credentials Confusion

Hello helpful people,

I have a SQL 2005 server with a local system Service account, I'm not allowed to change this to a domain account. I need to access a remote server to read flat files, this requires a domain account for access. I'm running the stored procedure (sp)

sp_OACreate

1) if I execute as the 'sqluser' account I cannot access the file (obviously!) 2) if I execute as the 'domain\user' account I cannot access the file 3) if I change the SQL Service account to the 'domain\user' account I can access the file 4) if I attempt to create a Credential for the SQL Service account I cannot access the file i.e.

CREATE CREDENTIAL SQLCred WITH IDENTITY = 'domain\user', SECRET = 'DomainPassword' go ALTER LOGIN [sqllogin] WITH CREDENTIAL = SQLCred GO

Q: I need to mimic the Service account having domain access, what am I missing??

thanks for reading

sql-server-2005security
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Jay D avatar image
Jay D answered

See http://msdn.microsoft.com/en-us/library/ms188304.aspx

regarding impersonation and see the EXECUTE AS syntax and usage at: http://msdn.microsoft.com/en-us/library/ms181362.aspx

I haven't had occasion to use this before, so I can't offer any other helpful suggestions.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.