Professional Web Applications Themes

bulk insert error: 'Operating system error code 5(Access is denied.)' - Microsoft SQL / MS SQL Server

the 'exception' when this command is ran: sqlstr = "BULK INSERT [Mink].[dbo].[TBL_Client_stage0]" + _ " FROM '\nas01\r$\Program1.txt' WITH (CHECK_CONSTRAINTS, FIELDTERMINATOR = '\t', KEEPNULLS, MAXERRORS =100)" sqlInsertCommand2.CommandText = sqlstr sqlInsertCommand2.ExecuteNonQuery() sqlstr = Nothing it runs great on server05, but the client wants the text on nas01...any ideas please? thanks, Trint ..Net programmer com *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...

  1. #1

    Default bulk insert error: 'Operating system error code 5(Access is denied.)'

    the 'exception' when this command is ran:

    sqlstr = "BULK INSERT [Mink].[dbo].[TBL_Client_stage0]" + _
    " FROM '\\nas01\r$\Program1.txt' WITH (CHECK_CONSTRAINTS,
    FIELDTERMINATOR = '\t', KEEPNULLS, MAXERRORS =100)"
    sqlInsertCommand2.CommandText = sqlstr
    sqlInsertCommand2.ExecuteNonQuery()
    sqlstr = Nothing

    it runs great on server05, but the client wants the text on nas01...any
    ideas please?
    thanks,
    Trint


    ..Net programmer
    com

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Trint Guest

  2. #2

    Default bulk insert error: 'Operating system error code 5(Access is denied.)'

    Try giving the sql server service account permission on
    the share.
    I would advise creating a share specifically for this.
    Give everyone full control to it to get it working then
    restrict permisssions.
     

    (CHECK_CONSTRAINTS, 
    on nas01...any 
    *** 
    Nigel Guest

  3. #3

    Default Re: bulk insert error: 'Operating system error code 5(Access is denied.)'

    The SQL Server service account needs to be a member of the local
    Administrators group on nas01. This is because you are using an
    administrative share (r$) un your UNC path.

    --
    Hope this helps.

    Dan Guzman
    SQL Server MVP

    -----------------------
    SQL FAQ links (courtesy Neil Pike):

    http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
    http://www.sqlserverfaq.com
    http://www.mssqlserver.com/faq
    -----------------------

    "Trint Smith" <com> wrote in message
    news:phx.gbl... 
    nas01...any 


    Dan Guest

  4. #4

    Default Re: bulk insert error: 'Operating system error code 5(Access is denied.)'

    Dan,
    how do i do that? do i use the enterprise manager?
    i just emailed the client and told him to do that in sql and he said it
    was already set up that way...i don't really know what to tell him now
    until i know how you are suggesting to do that..
    thanks,
    Trint

    ..Net programmer
    com

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Trint Guest

  5. #5

    Default Re: bulk insert error: 'Operating system error code 5(Access is denied.)'

    Yes, you should always use Enterprise Manager to specify SQL Server
    service accounts.

    If your client is certain that the SQL Server service account is a
    member of the nas01 server local Administrators group, perhaps
    folder/file permissions have been applied so that the account doesn't
    have access. For debugging, you might have your client login
    interactively using the service account to see if the file is accessible
    using the UNC via Windows Explorer.

    --
    Hope this helps.

    Dan Guzman
    SQL Server MVP


    "Trint Smith" <com> wrote in message
    news:%phx.gbl... 
    it 


    Dan Guest

Similar Threads

  1. Error "creating file: 1008:5, -5000 Access Denied Error"
    By tcervo in forum Macromedia Flash Player
    Replies: 9
    Last Post: May 3rd, 11:51 PM
  2. Bulk Insert Error
    By Dan in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: August 10th, 06:52 AM
  3. Error: This operating system is not supported by this installation. Etc.
    By Peggy Fleischmann in forum Adobe Photoshop Elements
    Replies: 1
    Last Post: July 26th, 06:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139