getting the server name the package is running on

  • I am writing a package that will be writing a file out to a share on the server.

    This used to be done with sp_makeWebTask. This made it easy to always have the file saved on the correct server as we would simply use

    @Filename = @@servername + @restOfFileName

    How using an SSIS package do i dynamically get the server name that a package is running under, store this in a variable and use this servername in the path a file will be written out to?

  • winston Smith (10/21/2009)


    I am writing a package that will be writing a file out to a share on the server.

    This used to be done with sp_makeWebTask. This made it easy to always have the file saved on the correct server as we would simply use

    @Filename = @@servername + @restOfFileName

    How using an SSIS package do i dynamically get the server name that a package is running under, store this in a variable and use this servername in the path a file will be written out to?

    You have @[System::MachineName] variable, which contains the machine name under which the package is executing. You can find more information about the other system variables here:

    http://msdn.microsoft.com/en-us/library/ms141788.aspx

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

Viewing 2 posts - 1 through 1 (of 1 total)

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