![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a table witrh a number of rows i.e. 12 rows of information as follows:- 101987 12345 Dan Smith 01256 33444 etc.. What i need to do is populate another table with the above data in columns : e.g 101987 12345 Dan Smith 01256 33444 etc.. Any ideas as i am at a loggerhead as how to do this in DTS as a Novice or near novice NOW!!! Thanks Ian |
#3
| |||
| |||
|
|
I have a table witrh a number of rows i.e. 12 rows of information a follows: 10198 1234 Dan Smit 01256 3344 etc. What i need to do is populate another table with the above data in column e.g 101987 12345 Dan Smith 01256 33444 etc. Any ideas as i am at a loggerhead as how to do this in DTS as a Novice o near novice NOW!! Thank Ia |
#4
| |||
| |||
|
|
Allan, the data on the source has a fixed number of rows i.e. there are 15 rows that need to be turned into different atrributes in a single row. so in |
|
If that makes sense does the use of rowset still apply and will try to get an example from somewhere as the book i have is like useless on rowset!! Cheers Ian ----- Allan Mitchell wrote: ----- So you have 1 attribute many rows That you want to turn into Many attributes 1 row. Do you have many destination rows in your source or just 1? How do you know when a row ends? How do you know the mappings? You can do this a number of way from 1. Reading the source into a recordset and then populating vriables and putting them into the destination to n. reading the rows as they come through in DTS, assign to variables and when you reach the magic end of row then insert to the destination. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Ian Clark" <iclark2001 (AT) hotmail (DOT) com> wrote in message news:2ED6A79E-1C9E-49A9-98E8-79D4D6D171FF (AT) microsoft (DOT) com... I have a table witrh a number of rows i.e. 12 rows of information as follows:- 101987 12345 Dan Smith 01256 33444 etc.. What i need to do is populate another table with the above data in columns : e.g 101987 12345 Dan Smith 01256 33444 etc.. Any ideas as i am at a loggerhead as how to do this in DTS as a Novice or near novice NOW!!! Thanks Ian |
#5
| |||
| |||
|
|
Allan the data on the source has a fixed number of rows i.e. there are 15 row that need to be turned into different atrributes in a single row. so i |
|
If that makes sens does the use of rowset still apply and will try to get an example fro somewhere as the book i have is like useless on rowset! Cheer Ia ----- Allan Mitchell wrote: ---- So you hav 1 attribute many row That you want to turn int Many attributes 1 row Do you have many destination rows in your source or just 1 How do you know when a row ends How do you know the mappings You can do this a number of way fro 1. Reading the source into a recordset and then populating vriable an putting them into the destinatio t n. reading the rows as they come through in DTS, assign to variable an when you reach the magic end of row then insert to the destination -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP www.SQLDTS.com - The site for all your DTS needs I support PASS - the definitive, global communit for SQL Server professionals - http://www.sqlpass.or "Ian Clark" <iclark2001 (AT) hotmail (DOT) com> wrote in messag news:2ED6A79E-1C9E-49A9-98E8-79D4D6D171FF (AT) microsoft (DOT) com.. I have a table witrh a number of rows i.e. 12 rows of informatio a follows: 10198 1234 Dan Smit 01256 3344 etc. What i need to do is populate another table with the above data i column e.g 101987 12345 Dan Smith 01256 33444 etc. Any ideas as i am at a loggerhead as how to do this in DTS as Novice or near novice NOW!!! Thanks Ian |
#6
| |||
| |||
|
|
Tried this but comes up with some odd results - any idea of whether i am being a REAL Novice!!! or just a Wally '************************************************* ********************* ' Visual Basic Transformation Script '************************************************* *********************** DIM a,b,c,d,e,f,g,h,i Function Main() a=DTSSource("Col002") Main=DTSTransformStat_SkipInsert b=DTSSource("Col002") Main=DTSTransformStat_SkipInsert c=DTSSource("Col002") Main=DTSTransformStat_SkipInsert d=DTSSource("Col002") Main=DTSTransformStat_SkipInsert e=DTSSource("Col002") Main=DTSTransformStat_SkipInsert f=DTSSource("Col002") Main=DTSTransformStat_SkipInsert g=DTSSource("Col002") Main=DTSTransformStat_SkipInsert h=DTSSource("Col002") Main=DTSTransformStat_SkipInsert i=DTSSource("Col002") Main=DTSTransformStat_SkipInsert DTSDestination("Col001")=a DTSDestination("Col002")=b DTSDestination("Col003")=c DTSDestination("Col004")=d DTSDestination("Col005")=e DTSDestination("Col006")=f DTSDestination("Col007")=g DTSDestination("Col008")=h DTSDestination("Col009")=i main=DTSTransformStat_OK End Function ----- Allan Mitchell wrote: ----- Yuk OK The only real way I can see to do this is to read the values into variables. You have a counter which counts to 15. When it reaches 15 then all your variables should be full and you can then do an insert on the destination. Not pretty but then your data isn't either. Need anything else shout. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Ian Clark" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:54E55743-F8EE-47FE-A810-6C9BC8632A67 (AT) microsoft (DOT) com... Allan, the data on the source has a fixed number of rows i.e. there are 15 rows that need to be turned into different atrributes in a single row. so in effect i want to read the first record column 1 from the Source and place in Column1 on the destination, read second row and place column1 in source in column2 of destination and repeat for all 15 rows before cycling to the next logical record in the destination table. If that makes sense does the use of rowset still apply and will try to get an example from somewhere as the book i have is like useless on rowset!! Cheers Ian ----- Allan Mitchell wrote: ----- So you have 1 attribute many rows That you want to turn into Many attributes 1 row. Do you have many destination rows in your source or just 1? How do you know when a row ends? How do you know the mappings? You can do this a number of way from 1. Reading the source into a recordset and then populating vriables and putting them into the destination to n. reading the rows as they come through in DTS, assign to variables and when you reach the magic end of row then insert to the destination. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Ian Clark" <iclark2001 (AT) hotmail (DOT) com> wrote in message news:2ED6A79E-1C9E-49A9-98E8-79D4D6D171FF (AT) microsoft (DOT) com... I have a table witrh a number of rows i.e. 12 rows of information as follows:- 101987 12345 Dan Smith 01256 33444 etc.. What i need to do is populate another table with the above data in columns : e.g 101987 12345 Dan Smith 01256 33444 etc.. Any ideas as i am at a loggerhead as how to do this in DTS as a Novice or near novice NOW!!! Thanks Ian |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
I have a table witrh a number of rows i.e. 12 rows of information as follows:- 101987 12345 Dan Smith 01256 33444 etc.. What i need to do is populate another table with the above data in columns : e.g 101987 12345 Dan Smith 01256 33444 etc.. Any ideas as i am at a loggerhead as how to do this in DTS as a Novice or near novice NOW!!! Thanks Ian My main suggestion here: how do you distinguish the beginning of each |
![]() |
| Thread Tools | |
| Display Modes | |
| |