How can I connect to a network drive in a connection?

  • I've got a fully working job that runs on a schedule and puts an excel file onto a local drive. Trouble is, the file needs to go to a folder on a drive in another domain, and the login for the domain is different to my login.

    I've mapped a drive locally, but the first time I click on it each session, I have to type in the domain\user id and the password. How can I replicate this in my SSIS package?

    What I really need is to be able to test if I am already connected and then connect if not, but one step at a time I guess

  • Did you try excel destination?

    Also, you would probably need to save the login/password by doing so in the property window.

    [font="Verdana"]Imagination is more important than knowledge-Albert Einstein[/font]

  • My job has 3 steps. I use the file system task to copy an existing excel file to the output location. The next 2 steps have 3 destinations between them.

    It's got to be this way because the source excel file holds pivots, headings and macros to control the eventual output.

    So the destination is already in its final home before the second and third packages write to it.

    Perhaps I'm missing something but I can't see a way around this at the moment

  • did you try net use \\uncname\.... usersxxx pwdyyy

    (keep in mind to unmap it in the next step)

    Check dos-help

    mapped drives are only for the user that is currently logged in.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • When you did the package, you said that you don't have problems with it in your local machine. So, can I assume that you have followed each step of package deploying to bring that package to the other server? Or are you still trying to get to the domain from your local? If this is the case, there can be many other reason that it is failing as you can be not in the admin group and so on. I tried similar package and did a deploy on my other server and it work. In the other hand, I tried the way you did too. It worked also. But then, I have the rights for the group. That probably the reason it worked.

    [font="Verdana"]Imagination is more important than knowledge-Albert Einstein[/font]

  • I guess that sums up my 2 problems 🙂

    1. If it's on a schedule, who is logged in?

    2. How to to do anything that is not an SSIS package

    I'm very new to this, and it's looking as if I will have to do a script. I've been looking at these all day, and have hit a few brick walls.

    I have an example of some vba from an Access project that does exactly what I want, and have been trying to port it into SQL Server, but haven't been able to make it work, so I was hoping there was an easy way in SSIS

  • SQL King (3/6/2008)


    When you did the package, you said that you don't have problems with it in your local machine. So, can I assume that you have followed each step of package deploying to bring that package to the other server? Or are you still trying to get to the domain from your local? If this is the case, there can be many other reason that it is failing as you can be not in the admin group and so on. I tried similar package and did a deploy on my other server and it work. In the other hand, I tried the way you did too. It worked also. But then, I have the rights for the group. That probably the reason it worked.

    I've got the whole job, all packages, working on my local server, which is where they will always run. The final output is meant to be delivered to a remote server though. I don't have my own login to this server, but I have a generic one that does

    I've just posted that we can do it from Access but I can't work out how to do it from SQL Server. Also, when in access, the job would be manually run by someone who is logged in. It wouldn't be on a schedule like I plan this one to be

  • you could define a sql2005 proxy that has the needed rights at the destination folder and assing that proxy to the jobstep.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • I've spent the morning trying to make the proxy work, to no avail. I'm really too new to SQL Server to understand how this works properly.

    I know the code works in Access, so I'm wondering if I can copy the code into the Excel VBA then call it from SSIS.

    The idea is that the spreadsheet would be prepared locally, as it is now, by the 3 existing packages, then a 4th package would run that would call the macro to assign the drive and save the workbook to the new location.

    Is it possible to run a macro inside a workbook from SSIS?

  • with SSIS you can use the script component !

    that one supports vbs.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Cheers, ALZDBA, you're really trying to help out!

    I tried scripts yesterday and couldn't make them work either.

    I know I'm thick but I've got a course scheduled at the end of March. It's just that I needed to crack this sooner.

    I learned by example to create the packages that have produced the workbook. I have looked for examples for scripts and proxy, but haven't found anything in context that I can implement.

    The VB stuff in SQL Server 2005 is way different to VBA, and Microsoft help is not as good as it was 10 years ago. Then, the online books had really useful examples, but some of their pages online now won't even display properly! :rolleyes:

Viewing 11 posts - 1 through 10 (of 10 total)

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