![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have the foll TEXT file id doc name 0 1 test 0 2 test2 I need to import it into a table with the same columns id,doc,name but I need to pass my own value for the ID instead of using the values from the textfile so is it possible to pass a parameter to the text file import. On my DTS package I have a text file (source) object and OLEDB connection object and they are connected with a data transformation but I don't see any field to set up as a parameter of global variable. Any ideas? Thanks |
#3
| |||
| |||
|
|
Yep sure you can do this when you look at the transformations unmap the column that goes from the text file to the destination. No create a Global Variable as an integer variable and set the initial value to 0 In your transformations again highlight the destination column NO source columns and add a new Active Script transform. in the code add DTSGlobalVariables("Name of variable").Value = Cint(DTSGlobalVariables("Name of variable").Value) + 1 DTSDestination("Column Name") = DTSGlobalVariables("Name of variable").Value -- 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:0888B45E-65F0-42ED-8FAA-D79B85BFD338 (AT) microsoft (DOT) com... Hi, I have the foll TEXT file id doc name 0 1 test 0 2 test2 I need to import it into a table with the same columns id,doc,name but I need to pass my own value for the ID instead of using the values from the textfile so is it possible to pass a parameter to the text file import. On my DTS package I have a text file (source) object and OLEDB connection object and they are connected with a data transformation but I don't see any field to set up as a parameter of global variable. Any ideas? Thanks |
#4
| |||
| |||
|
|
Hi, Where do I created the global variable> I don't see any button or field to do so. "Allan Mitchell" wrote: Yep sure you can do this when you look at the transformations unmap the column that goes from the text file to the destination. No create a Global Variable as an integer variable and set the initial value to 0 In your transformations again highlight the destination column NO source columns and add a new Active Script transform. in the code add DTSGlobalVariables("Name of variable").Value = Cint(DTSGlobalVariables("Name of variable").Value) + 1 DTSDestination("Column Name") = DTSGlobalVariables("Name of variable").Value -- 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:0888B45E-65F0-42ED-8FAA-D79B85BFD338 (AT) microsoft (DOT) com... Hi, I have the foll TEXT file id doc name 0 1 test 0 2 test2 I need to import it into a table with the same columns id,doc,name but I need to pass my own value for the ID instead of using the values from the textfile so is it possible to pass a parameter to the text file import. On my DTS package I have a text file (source) object and OLEDB connection object and they are connected with a data transformation but I don't see any field to set up as a parameter of global variable. Any ideas? Thanks |
#5
| |||
| |||
|
|
Yep sure you can do this when you look at the transformations unmap the column that goes from the text file to the destination. No create a Global Variable as an integer variable and set the initial value to 0 In your transformations again highlight the destination column NO source columns and add a new Active Script transform. in the code add DTSGlobalVariables("Name of variable").Value = Cint(DTSGlobalVariables("Name of variable").Value) + 1 DTSDestination("Column Name") = DTSGlobalVariables("Name of variable").Value -- 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:0888B45E-65F0-42ED-8FAA-D79B85BFD338 (AT) microsoft (DOT) com... Hi, I have the foll TEXT file id doc name 0 1 test 0 2 test2 I need to import it into a table with the same columns id,doc,name but I need to pass my own value for the ID instead of using the values from the textfile so is it possible to pass a parameter to the text file import. On my DTS package I have a text file (source) object and OLEDB connection object and they are connected with a data transformation but I don't see any field to set up as a parameter of global variable. Any ideas? Thanks |
#6
| |||
| |||
|
|
right click on the package whitespace | Package Properties | Global Variables -- 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:0FF0AC5A-F65A-4EC1-B691-D7E822AB1363 (AT) microsoft (DOT) com... Hi, Where do I created the global variable> I don't see any button or field to do so. "Allan Mitchell" wrote: Yep sure you can do this when you look at the transformations unmap the column that goes from the text file to the destination. No create a Global Variable as an integer variable and set the initial value to 0 In your transformations again highlight the destination column NO source columns and add a new Active Script transform. in the code add DTSGlobalVariables("Name of variable").Value = Cint(DTSGlobalVariables("Name of variable").Value) + 1 DTSDestination("Column Name") = DTSGlobalVariables("Name of variable").Value -- 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:0888B45E-65F0-42ED-8FAA-D79B85BFD338 (AT) microsoft (DOT) com... Hi, I have the foll TEXT file id doc name 0 1 test 0 2 test2 I need to import it into a table with the same columns id,doc,name but I need to pass my own value for the ID instead of using the values from the textfile so is it possible to pass a parameter to the text file import. On my DTS package I have a text file (source) object and OLEDB connection object and they are connected with a data transformation but I don't see any field to set up as a parameter of global variable. Any ideas? Thanks |
#7
| |||
| |||
|
|
right click on the package whitespace | Package Properties | Global Variables -- 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:0FF0AC5A-F65A-4EC1-B691-D7E822AB1363 (AT) microsoft (DOT) com... Hi, Where do I created the global variable> I don't see any button or field to do so. "Allan Mitchell" wrote: Yep sure you can do this when you look at the transformations unmap the column that goes from the text file to the destination. No create a Global Variable as an integer variable and set the initial value to 0 In your transformations again highlight the destination column NO source columns and add a new Active Script transform. in the code add DTSGlobalVariables("Name of variable").Value = Cint(DTSGlobalVariables("Name of variable").Value) + 1 DTSDestination("Column Name") = DTSGlobalVariables("Name of variable").Value -- 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:0888B45E-65F0-42ED-8FAA-D79B85BFD338 (AT) microsoft (DOT) com... Hi, I have the foll TEXT file id doc name 0 1 test 0 2 test2 I need to import it into a table with the same columns id,doc,name but I need to pass my own value for the ID instead of using the values from the textfile so is it possible to pass a parameter to the text file import. On my DTS package I have a text file (source) object and OLEDB connection object and they are connected with a data transformation but I don't see any field to set up as a parameter of global variable. Any ideas? Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |