1st Time with Global Variables

  • I need help. I am creating a DTS Package that will need to use Global Variables. I know how to create them, but I am unaware on how to utilize them in and insert statement.

    I will keep this very simple.

    All I will be doing is creating a Global Temporary Table and inserting into it.

    I do not know how to accomplish the follwing, within my DTS Package:

    Insert into ##Temp values (GlobalVariable1, GlobalVariable2).

    This is all I need to do. Can someone please help me.

    Thanks in advance.

  • Once you have your global variables defined, you need to establish a 'placeholder' in your sql statement for them. In your case, the sql would look like, 'INSERT ##TEMP(field1, field2) VALUES(?,?)'. The '?' is a placeholder for the global variable that you are passing in. Then click on global variables (in your execute sql task) and assign the variables in the proper order. I hope this makes sense...I haven't finished my coffee yet!

    hth,

    Michael

    Michael Weiss


    Michael Weiss

  • I must be missing something, because I do not see a Global Variables are within SQL Tasks. Where is it.

    This is what I did. I opened and SQL Task and typed the insert statement, using the ? as place holders. Now that I have done this, i'm not 100% on what you mean by "click on global variables." Can you please expand on this.

    thanks for your help and patience.

  • Don't bother I just figured it out. Thanks for the help.

Viewing 4 posts - 1 through 3 (of 3 total)

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