Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6827861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:18:54+00:00 2026-05-26T22:18:54+00:00

We have some code that we want to run a BULK INSERT sql command,

  • 0

We have some code that we want to run a BULK INSERT sql command, but it’s getting access denied because the account SQLAgent is installed as doesn’t have permissions to the folder the file is in. I don’t want that account to have permissions to that folder, and would love to use a proxy account if I could instead.

Don’t think this helps much, but here’s the vb code we’re using to run the sql command:

        Dim sql As String = "BULK INSERT Visa From '@file' With (ROWTERMINATOR = '\n', FIELDTERMINATOR = '\t', KEEPNULLS)"
        sql = Replace(sql, "@period", _date)
        sql = Replace(sql, "@file", FullPath)
        DBExecute(sql)

How to get this to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:18:55+00:00Added an answer on May 26, 2026 at 10:18 pm

    As HardCode wrote, You can use RunAs for each job step. Basically, You have to:

    • add credentials – credentials means: “impersonate to this credentials”
    • add proxy – proxy means: link between credentials and type of actions (subsystems) like running SSIS package, running command, …
    • configure job step to use added proxy

    Note that credentials You use has to have permissions to access the folder as well as permissions to connect to databse. Later is not needed if You use SQL Server login instead of Windows Authentication in your VB.NET code.

    Here You can find step by step instructions on how to add credentials and proxy.

    UPDATE: your comment shed some light on original question. You didn’t want to change job step proxy/credentials but to use .NET to impersonate user.

    You can achieve this by:

    • switching to SQL Server login – dangerous because You have to save password in connection string
    • impersonating user using .NET code – check articles: how to impersonate user and check this one for very good security hint
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some jQuery/JavaScript code that I want to run only when there is
I have some code that essentially does what I want but I always like
I have some code that I want to run in a utility application whenever
I have some code that I want to put into an svn repository for
I have a normal asp.net page containing some code that I want to measure
I have a standalone Java app that has some licensing code that I want
I have some java code that I want to share with some classmates however
I have some code that uses an Informix 11.5 database that I want to
We have some code that must access low level windows XP os calls which
I have some c code that I compile and run, in a directory that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.