User initializes variable through VB in a DTS package? Is it possible?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • antonopn
    New Member
    • Mar 2008
    • 42

    #1

    User initializes variable through VB in a DTS package? Is it possible?

    Hello there!

    I'm really confused about this! I have created a project (DTS in SQL SERVER 2000) which imports a txt file and runs some SQL statements. I want the user who runs it each time to initialize a variable, which is a sql variable (ex. @userdate). I 've been thinking using an Active X script inside the DTS and when the DTS is executed, a form (or something) will come up and the user will set the variable value (this is a datetime value).

    Can you PLEASE HELP ME?
    THANKS IN ADVANCE!
  • antonopn
    New Member
    • Mar 2008
    • 42

    #2
    Well I found a solution using activeX script.
    This link really helped me a lot!
    http://www.sqlserverce ntral.com/articles/DTS/2929/

    THERE IS ANOTHER PROBLEM though!

    I've created a global variable (string) with the name @P1.

    After the ActiveX, a SQL Task is executed. When I try ti use this global variable I get an error.

    example
    Code:
    insert into mytable (mystring) values (@P1)
    "must declare the variable @P1"

    Any suggestions???

    Comment

    Working...