![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a dts package that reads a text file and enters the data in a table. There is a global variable which I have to pass the value when executing the package. Instead of passing a value I want the package to do everything. All I have to do is ececute the package. I created an sql task that will get a value form a table and then assign it to the global variable but, how do I assign it to the globalvariable so that the next tasg can pickup the value form the global variable? The order I have i is 1. SQL task object gets value form table and assign to global variable. -------here I need help! 2. gets value form global variable and performs file import. Thanks |
#3
| |||
| |||
|
|
Text files will not support variables like this so you will need to import to a temp table first As for reading a value from a table and inserting into a GV have a look here How to Use Lookups in DTS (http://www.sqldts.com/default.aspx?277,7) You want pages 7 and 8. Whilst we use input parameters here you want an aoutput parameter of the row value so it may look like this your statement SELECT SUM(column) as Val FROM TABLE Make sense? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:E43F7248-D630-4980-8EC2-E687152F91BA (AT) microsoft (DOT) com... Hi, I have a dts package that reads a text file and enters the data in a table. There is a global variable which I have to pass the value when executing the package. Instead of passing a value I want the package to do everything. All I have to do is ececute the package. I created an sql task that will get a value form a table and then assign it to the global variable but, how do I assign it to the globalvariable so that the next tasg can pickup the value form the global variable? The order I have i is 1. SQL task object gets value form table and assign to global variable. -------here I need help! 2. gets value form global variable and performs file import. Thanks |
#4
| |||
| |||
|
|
Hi, I need to assign the result from my query to the global variable. example (sql task in the package) select id from table where name = 'test' I then need to then pass that value in id to the global variable so the second object in my dts would then pick up that value and continue. "Allan Mitchell" wrote: Text files will not support variables like this so you will need to import to a temp table first As for reading a value from a table and inserting into a GV have a look here How to Use Lookups in DTS (http://www.sqldts.com/default.aspx?277,7) You want pages 7 and 8. Whilst we use input parameters here you want an aoutput parameter of the row value so it may look like this your statement SELECT SUM(column) as Val FROM TABLE Make sense? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:E43F7248-D630-4980-8EC2-E687152F91BA (AT) microsoft (DOT) com... Hi, I have a dts package that reads a text file and enters the data in a table. There is a global variable which I have to pass the value when executing the package. Instead of passing a value I want the package to do everything. All I have to do is ececute the package. I created an sql task that will get a value form a table and then assign it to the global variable but, how do I assign it to the globalvariable so that the next tasg can pickup the value form the global variable? The order I have i is 1. SQL task object gets value form table and assign to global variable. -------here I need help! 2. gets value form global variable and performs file import. Thanks |
#5
| |||
| |||
|
|
The ExecuteSQL task does the assignment to a Global Variable. What is the next task that uses the GV? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:F750E43C-3537-41F8-9CEB-E734D367DC25 (AT) microsoft (DOT) com... Hi, I need to assign the result from my query to the global variable. example (sql task in the package) select id from table where name = 'test' I then need to then pass that value in id to the global variable so the second object in my dts would then pick up that value and continue. "Allan Mitchell" wrote: Text files will not support variables like this so you will need to import to a temp table first As for reading a value from a table and inserting into a GV have a look here How to Use Lookups in DTS (http://www.sqldts.com/default.aspx?277,7) You want pages 7 and 8. Whilst we use input parameters here you want an aoutput parameter of the row value so it may look like this your statement SELECT SUM(column) as Val FROM TABLE Make sense? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:E43F7248-D630-4980-8EC2-E687152F91BA (AT) microsoft (DOT) com... Hi, I have a dts package that reads a text file and enters the data in a table. There is a global variable which I have to pass the value when executing the package. Instead of passing a value I want the package to do everything. All I have to do is ececute the package. I created an sql task that will get a value form a table and then assign it to the global variable but, how do I assign it to the globalvariable so that the next tasg can pickup the value form the global variable? The order I have i is 1. SQL task object gets value form table and assign to global variable. -------here I need help! 2. gets value form global variable and performs file import. Thanks |
#6
| |||
| |||
|
|
Hi, The next task is a transform data task that takes data from a text file and import it to a table. The transform data task takes data form the text file based on the value of the Global Variable. How does the ExecuteSQL task assign the value to the global variable? "Allan Mitchell" wrote: The ExecuteSQL task does the assignment to a Global Variable. What is the next task that uses the GV? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:F750E43C-3537-41F8-9CEB-E734D367DC25 (AT) microsoft (DOT) com... Hi, I need to assign the result from my query to the global variable. example (sql task in the package) select id from table where name = 'test' I then need to then pass that value in id to the global variable so the second object in my dts would then pick up that value and continue. "Allan Mitchell" wrote: Text files will not support variables like this so you will need to import to a temp table first As for reading a value from a table and inserting into a GV have a look here How to Use Lookups in DTS (http://www.sqldts.com/default.aspx?277,7) You want pages 7 and 8. Whilst we use input parameters here you want an aoutput parameter of the row value so it may look like this your statement SELECT SUM(column) as Val FROM TABLE Make sense? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Chris" <Chris (AT) discussions (DOT) microsoft.com> wrote in message news:E43F7248-D630-4980-8EC2-E687152F91BA (AT) microsoft (DOT) com... Hi, I have a dts package that reads a text file and enters the data in a table. There is a global variable which I have to pass the value when executing the package. Instead of passing a value I want the package to do everything. All I have to do is ececute the package. I created an sql task that will get a value form a table and then assign it to the global variable but, how do I assign it to the globalvariable so that the next tasg can pickup the value form the global variable? The order I have i is 1. SQL task object gets value form table and assign to global variable. -------here I need help! 2. gets value form global variable and performs file import. Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |