Re: Problem with bulk load security.
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 04 Feb 2009 14:57:58 -0800
(rbielaws@xxxxxxxxx) writes:
I was trying to impersonate a user that worked.
But I tried what you suggested and as expected got a syntax error.
create PROCEDURE Import_File
( @param ...
) with execute as login = 'dom\svc_id'
as
begin ...
.Net SqlClient Data Provider: Msg 102, Level 15, State 1, Procedure
Import_File, Line 10
Incorrect syntax near 'login'.
So I tried this too.
No, I did not suggest that. I suggested that you should try:
EXECUTE AS LOGIN = '<service account>'
go
BULK INSERT ....
go
REVERT
There is no CREATE PROCEDURE there. Just a plain EXECUTE AS statement.
The EXECUTE AS *statement* is the only way to impersonate a login.
Try the above from a query window. If this works, review the thread
and look at my earliers posts, how you could use this in a stored
procedure.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: Problem with bulk load security.
- From: rbielaws
- Re: Problem with bulk load security.
- References:
- Re: Problem with bulk load security.
- From: rbielaws
- Re: Problem with bulk load security.
- From: Erland Sommarskog
- Re: Problem with bulk load security.
- From: rbielaws
- Re: Problem with bulk load security.
- Prev by Date: Re: same user/login for different databases on same instance
- Next by Date: Re: Where is the connection attempt coming from?
- Previous by thread: Re: Problem with bulk load security.
- Next by thread: Re: Problem with bulk load security.
- Index(es):
Relevant Pages
|