Author |
Topic |
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 02:02:03
|
Hi All, Here is my sample source fileAdvert,Network,ProgramAcorn,NULL,NULLNULL,AC,NULLNULL,NULL,Adultand I wantAdvert,Network,ProgramAcorn,AC,AdultPlease help/guide, its urgent.Thank You in Advance. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-10-25 : 02:34:32
|
your table only have 3 records ?select max(advert), max(network), max(program) from sample_source_file KH[spoiler]Time is always against us[/spoiler] |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 02:43:31
|
No, this is just a sample data here is in detail sample fileAdvert,Network,ProgramAcorn,NULL,NULLNULL,AC,NULLNULL,NULL,AdultJame,Null,NullNull,IC,NullNull,Null,YoungNull,Null,AdultFix,Null,NullNull,GM,NullNull,Null,KidThe first three rows are set of Advert = AcornSecond four rows are set of Advert = Jameand last three rows are set of Advert = FixThank You. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-10-25 : 02:47:20
|
how do you identify which rows belong to the same set ? Is there another column in the table that is able to do that ? KH[spoiler]Time is always against us[/spoiler] |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 02:52:44
|
No there is no other column. How do I identify, to be honest not sure. As per excel file that we are receiving its like that. In first column (Advert) is null its mean its with the same set and if its not null its mean new sets start. |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 02:54:24
|
Actually what I am doing, receiving file from Client with this crazy format. From this file I just need few columns and create a , separated file. |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 02:56:32
|
and I am using SSIS for this project/task. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-10-25 : 02:57:40
|
for your information, records in table is not stored in any particular sequence or ordering. You define how the ordering of records retrieve by using ORDER BY clause.How do you import the data from excel into the table ? KH[spoiler]Time is always against us[/spoiler] |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 03:04:35
|
The Source File/Field (Advert) are always ace order. I mean that data is in excel file is always ACE order. Is there any way we can use update statement to update with previous value, here is below exampleFnameSmithJamesNullAfter updateFnameSmithJamesJames? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-10-25 : 03:14:25
|
quote: Is there any way we can use update statement to update with previous value
provided that you have a column to identify the ordering or sequence of records.Possible to fix the data in excel before import into SQL Server ? KH[spoiler]Time is always against us[/spoiler] |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 03:20:19
|
My source file/sample file like thisAdvert,Network,ProgramAcorn,NULL,NULLNULL,AC,NULLNULL,NULL,AdultFix,Null,NullNull,IC,NullNull,Null,YoungNull,Null,AdultJim,Null,NullNull,GM,NullNull,Null,Kidin Excel File. I want to do something in SSIS or I was thinking just straight dump the data in to SQL Table with create Row Number in SSIS and then use sql table on sql table. |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-10-25 : 03:23:19
|
We are receiving this file everyday from client, Cant fix this manually everyday and Client are not going to send different format file. I have to deal with this crazy format.... |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-10-25 : 03:34:05
|
you can try adding an identity column in the table, but I am not sure how SSIS imports from excel to table, probably there is a way to ensure the insertion is as per the sequence in excel ? KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|