Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SSIS package and package in a SQL server agent Job

SSIS package and package in a SQL server agent Job

Scheduled Pinned Locked Moved Database
sql-servercsharpdatabasevisual-studiosysadmin
5 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VK19
    wrote on last edited by
    #1

    Hello All, I have a SSIS package wherein the first step is excution of C# program to convert a csv file to excel file. The second step is the loading of this excel file into a table. This programs with no errors when execute from IDE. Now, i am setting the process as SQL server agent Job, and i give the path to the package for execution. The job fails with message that "Access is denied". I moved the package to C:\ drive. Now the program fails on first step with null reference. why the difference in results when executed from SSIS package environment versus the SQL server agent job? I did resolve this issue by removing the C# program execution and set it up as scheduled task, but would like to understand the behaviour. Many thanks

    CHill60C realJSOPR 2 Replies Last reply
    0
    • V VK19

      Hello All, I have a SSIS package wherein the first step is excution of C# program to convert a csv file to excel file. The second step is the loading of this excel file into a table. This programs with no errors when execute from IDE. Now, i am setting the process as SQL server agent Job, and i give the path to the package for execution. The job fails with message that "Access is denied". I moved the package to C:\ drive. Now the program fails on first step with null reference. why the difference in results when executed from SSIS package environment versus the SQL server agent job? I did resolve this issue by removing the C# program execution and set it up as scheduled task, but would like to understand the behaviour. Many thanks

      CHill60C Offline
      CHill60C Offline
      CHill60
      wrote on last edited by
      #2

      Sorry I can't help with the problem, but I am intriqued as to why you would convert a CSV to "excel" just to load it to a table... the step is totally unnecessary unless you need the xlsx file for something else as well.

      V 1 Reply Last reply
      0
      • CHill60C CHill60

        Sorry I can't help with the problem, but I am intriqued as to why you would convert a CSV to "excel" just to load it to a table... the step is totally unnecessary unless you need the xlsx file for something else as well.

        V Offline
        V Offline
        VK19
        wrote on last edited by
        #3

        There is one field in the csv file, a freeform field. The users have ability to type anything in this field, along with special characters. Since there was no common delimiter, had to go with converting the csv file to excel file route to load this file using SSIS.

        CHill60C 1 Reply Last reply
        0
        • V VK19

          Hello All, I have a SSIS package wherein the first step is excution of C# program to convert a csv file to excel file. The second step is the loading of this excel file into a table. This programs with no errors when execute from IDE. Now, i am setting the process as SQL server agent Job, and i give the path to the package for execution. The job fails with message that "Access is denied". I moved the package to C:\ drive. Now the program fails on first step with null reference. why the difference in results when executed from SSIS package environment versus the SQL server agent job? I did resolve this issue by removing the C# program execution and set it up as scheduled task, but would like to understand the behaviour. Many thanks

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          You should specify UNC paths when you're loading files in your packages. That way, it will work no matter where you put the file (as long as you're using the correct UNC path of course). BTW, you can write a script task in a package that will import that data (as opposed to running an external application). I wrote an article not to long ago that includes code to import excel and CSV files - SQLXAgent - Jobs for SQL Express - Part 3 of 6[^] I think you might find it useful. I'm currently extracting that code into it's own assembly for easier inclusion into projects like yours. It even goes to some length to determine the data type represented in each column.

          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
          -----
          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
          -----
          When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

          1 Reply Last reply
          0
          • V VK19

            There is one field in the csv file, a freeform field. The users have ability to type anything in this field, along with special characters. Since there was no common delimiter, had to go with converting the csv file to excel file route to load this file using SSIS.

            CHill60C Offline
            CHill60C Offline
            CHill60
            wrote on last edited by
            #5

            So it would be surrounded by quotes in the csv.. I stand by my comment

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups