Using TSQL to unzip rar file but I don't see the files.

  • I'm running the following TSQL

    EXEC master..xp_cmdshell '"C:\Program Files (x86)\WinRAR\unrar" e -y \\silverthrone\gadata\IPC\*.rar '

    My understanding is that this should unzip the files into the \\silverthrone\gadata\IPC\ directory but once it completes I can't see any files. Any idea what I'm doing wrong?

  • Does the SQL engine have permissions to that folder? Or the proxy? This doesn't run under your account, but the SQL database engine service account (or proxy)

  • How can I find that out?

  • Log in as the service account and try to run the command.

    Or run this:

    xp_cmdshell 'dir > \\silverthrone\gadata\IPC\dir.txt'

    That will tell you if you can write to that folder. Also, the path to the executable needs to be as if you logged onto the Windows host of the SQL Server. It doens't have anything to do with your local path, no matter where you run SSMS from

  • I rant the script but it returned a null

  • Did a file get created in the folder?

  • yes

  • Then it's not security. Is this valid on the SQL Server windows host?

    C:\Program Files (x86)\WinRAR\unrar

  • I believe so. When I run it it returns messages saying its extractiing the files

  • Found the issue. When I scrolled down to the bottom of the returned messages there was an error message stating that there isn't enough space for all of the files.

  • Ok, I thought I found the issue. I'm getting an error message stating

    Program aborted

    NULL

    There is not enough space on the disk.

    But I know there is enough space, I just deleted the files I unzipped manually and was testing my ssis pkg on.

  • I thought I found the issue. I delete the files that were there from when I unzipped it by right clicking it and reran the script and recieved the not enough space available on the drive.

  • sorry, didn't notice the post was going to the 2nd page

  • Is there a chance there's a quota? Can you log in as the service account and test that way? It might help track things down.

    Sorry for the delay in responding.

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply