Author |
Topic |
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-24 : 08:58:45
|
Hi All,Very Good Morning, Afternoon & Evening,i am very new to SSIS and currently getting opportunity using SSIS using 2008 R2 version.HELP ITEM1. currently i have Multiple XML file and i need to consolidate , Merge , Append the data - CLose to 100- xml File i have XML Schema for the same with me will share that at the end of the request.2. here i having difficulty in getting the Unique ID properly "ID929572783" that is not coming properly is generating own id like random number where i cannot map it back to my data.3. tried to change the data type for the Unique id from "DT_WSTR" to "DT_STR" no go so tried with other data type "DT_GUID" still no go it generating the own id.Tried this possible solution to merge the dataa.File Name - String - folder pathb.File Extension - String - *.xmlc.Full Path Name - output data path1. For Each Loop Container2. double clicked on "FELC" properties3. Under Collection For Each File Enumerator4. Folder Name - provided the path where all the XML is stored5. files - *.xml6. Retrieve File Name - Fully Qualify7. click on Variable Mapping8. Variables = User :: Full Path - Index = 09. Click on ok10. Dragged & Dropped Data Flow Task (DFT) double clicked11. Dragged & Dropped the XML Source, provided the Source xml file12. created the Schema and clicked ok13. right click XML Source and click on ADvanced Editor14. Input and Output Properties select the 11 tables / elements and changed the data type for all the Text files to "DT_NTEXT" as this was done by some other person where is he not available or not reachable15. clicked on ok16.tried to run the FELC and it populated the data in the respective table but it is not moving from one file to another file it is only doing for the same Session 1 it has to go till Session 100.need help in consolidating the XML & Session Id to be actual data not auto generated.XML SCHEMA <?xml version="1.0"?><xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Report"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="Session"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="Visitor"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="ip" type="xs:string" /> <xs:element minOccurs="0" name="agent" type="xs:string" /> <xs:element minOccurs="0" name="host" type="xs:string" /> <xs:element minOccurs="0" name="chatReferer" type="xs:string" /> <xs:element minOccurs="0" name="GeoInfo"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="geoCity" type="xs:string" /> <xs:element minOccurs="0" name="geoConType" type="xs:string" /> <xs:element minOccurs="0" name="geoCountry" type="xs:string" /> <xs:element minOccurs="0" name="geoIP" type="xs:string" /> <xs:element minOccurs="0" name="geoISP" type="xs:string" /> <xs:element minOccurs="0" name="geoLat" type="xs:decimal" /> <xs:element minOccurs="0" name="geoLong" type="xs:decimal" /> <xs:element minOccurs="0" name="geoOrg" type="xs:string" /> <xs:element minOccurs="0" name="geoPost" type="xs:string" /> <xs:element minOccurs="0" name="geoReg" type="xs:string" /> <xs:element minOccurs="0" name="geoTimeZone" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="id" type="xs:unsignedLong" use="optional" /> </xs:complexType> </xs:element> <xs:element minOccurs="0" name="Chat"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="line"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="URL" type="xs:string" /> <xs:element minOccurs="0" name="HTML" type="xs:string" /> <xs:element minOccurs="0" name="Text" type="xs:string" /> </xs:sequence> <xs:attribute name="by" type="xs:string" use="optional" /> <xs:attribute name="time" type="xs:dateTime" use="optional" /> <xs:attribute name="repId" type="xs:string" use="optional" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="start_time" type="xs:dateTime" use="optional" /> <xs:attribute name="end_time" type="xs:dateTime" use="optional" /> </xs:complexType> </xs:element> <xs:element minOccurs="0" name="VarValues"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="varValue"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="id" type="xs:string" use="optional" /> <xs:attribute name="source" type="xs:string" use="optional" /> <xs:attribute name="sourceName" type="xs:string" use="optional" /> <xs:attribute name="time" type="xs:dateTime" use="optional" /> <xs:attribute name="name" type="xs:string" use="optional" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element minOccurs="0" name="Reps"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="Rep"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="id" type="xs:string" use="optional" /> <xs:attribute name="repName" type="xs:string" use="optional" /> <xs:attribute name="startTime" type="xs:dateTime" use="optional" /> <xs:attribute name="endTime" type="xs:dateTime" use="optional" /> <xs:attribute name="order" type="xs:unsignedByte" use="optional" /> <xs:attribute name="employeeId" type="xs:string" use="optional" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="id" type="xs:string" use="optional" /> <xs:attribute name="realTimeID" type="xs:unsignedLong" use="optional" /> </xs:complexType> </xs:element> <xs:element minOccurs="0" name="Variables"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="var"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="title" type="xs:string" /> </xs:sequence> <xs:attribute name="id" type="xs:string" use="optional" /> <xs:attribute name="scope" type="xs:string" use="optional" /> <xs:attribute name="name" type="xs:string" use="optional" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="account" type="xs:unsignedInt" use="optional" /> <xs:attribute name="start_time" type="xs:dateTime" use="optional" /> <xs:attribute name="end_time" type="xs:dateTime" use="optional" /> <xs:attribute name="user" type="xs:string" use="optional" /> <xs:attribute name="limit" type="xs:unsignedShort" use="optional" /> <xs:attribute name="more_sessions" type="xs:boolean" use="optional" /> </xs:complexType> </xs:element></xs:schema>awaiting for your reply / please call meRegards,Karthik Shankaran (KS)99400 74724Regards,Karthik Shankaran (KS)+91-9940074724 |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-24 : 10:08:08
|
Hi Chandu,thanks for your prompt response, i have done the For Each Loop Container but i might be missing something in my steps . i dont know what i missed.it is asking to get the information from BOL i dont know what is that :( . i am currently using 2008 R2 version. please help. if you can provide me your contact number will call and explain you my scenario so that it might give you more idea on what the issue is.RegardsKS99400 74724Regards,Karthik Shankaran (KS)+91-9940074724 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-24 : 12:41:04
|
As I understand the only think you've missed here is to set an expression for xml source property to variable which gets the xml path value inside ForEachLoop. This will make sure the path gets changed automatically to each file's path and corresponding XML file being fetched by XML source and doing data transfer using data flow task to your table.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 00:25:44
|
Hi Visakh1. XML Source double clicked2. Data Access Mode - changed from "XML File Location" to "XML File From Variables"3. as created the Variables - Full Path4. clicked okstill not workingRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-25 : 00:50:23
|
quote: Originally posted by karmeeabi Hi Visakh1. XML Source double clicked2. Data Access Mode - changed from "XML File Location" to "XML File From Variables"3. as created the Variables - Full Path4. clicked okstill not workingRegards,Karthik Shankaran (KS)+91-9940074724
Put a break point in preexecute event of data flow task and check if variable is correctly getting XML file path------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 04:37:32
|
Hi Visakh,that fixed my Issue, now it is new issue that got created. as i have told you earlier it generate automatic id now it is repeating the same for all the XML file as unique i dont know how to get out of that. below mentioned are the steps i have followed.1. Defined 2 variables a. FullPath , String , Folder name where the XML are stored b. FileExtension , String, .xml2. Dragged & Dropped the FELC3. Double Click on it & clicked on "Collection"4. Under Enumerator Configuration - Provided the File Path Name where the XML are stored & for Files "*.xml" and selected "Fully Qualified"5. clicked on Variable Mappings - User::FullPath - Index = 0 and clicked ok6. Dragged & Dropped the DFT & Double Clicked7. Dragged & Dropped the XML Source, Dervied column & Destination Database8. XML SOurce right clicked on "Show Advance Editor" and "Input and Output Properties" changed for some of the Input & Output Child Node data type changed and clicked ok9.Derived Column double clicked and added a new column as "File Name" called the Variable " Full Path" and clicked ok10. Destination Database Connection Manager select the the destination server & database- double clicked and selected "Table or View - fast load" , unchecked Table Lock & CHeck Constraints & clicked on new, changed the Name while creating the table and clicked on Mappings - mapped the value appropriately and clicked on Error Output and clicked ok11. like this i have done for 11 elements / table which is available in the XML12. tried to ran / execute the SSIS it ran but got an error message for one of the 11 elements / table "Child Node - URL" Truncation error .i dont know how to rectify this issue + i also need to one more help i need to create a composite key i have never done this - it should be based on the File Name , Session Id & ID to get the actual Session ID for all the casescould you please help me to fix thisonce again that for the helpRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 04:42:55
|
This is the error message i am getting.[XML Source [1]] Error: The "component "XML Source" (1)" failed because truncation occurred, and the truncation row disposition on "output column "URL" (151)" at "output "line" (140)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.[XML Source [1]] Error: The component "XML Source" (1) was unable to process the XML data. Pipeline component has returned HRESULT error code 0xC02090FA from a method call.[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "XML Source" (1) returned error code 0xC02092AF. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.now i have changed the data type for line_URL to DT_Text and tried to changed the same in the table as well to check if that is fixing my issue will keep you posted on the sameRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-25 : 04:46:19
|
it generate automatic id now it is repeating the same for all the XML file as unique i dont know how to get out of thathow are you generating this id? using t-sql code?tried to ran / execute the SSIS it ran but got an error message for one of the 11 elements / table "Child Node - URL" Truncation error .The error may be because one of destination table fields will not have enough length to hold value from xml. compare datatypes between source and destination. Also check in derived column where you are applying any expression over data and make sure you're not causing the original data precision to be lost due to your expression which may also cause this errori also need to one more help i need to create a composite key i have never done this - it should be based on the File Name , Session Id & ID to get the actual Session ID for all the casesdo you mean setting composite primary key? or using an expression to concat all values to form surrogate key?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-25 : 04:52:51
|
quote: Originally posted by karmeeabi This is the error message i am getting.[XML Source [1]] Error: The "component "XML Source" (1)" failed because truncation occurred, and the truncation row disposition on "output column "URL" (151)" at "output "line" (140)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.[XML Source [1]] Error: The component "XML Source" (1) was unable to process the XML data. Pipeline component has returned HRESULT error code 0xC02090FA from a method call.[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "XML Source" (1) returned error code 0xC02092AF. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.now i have changed the data type for line_URL to DT_Text and tried to changed the same in the table as well to check if that is fixing my issue will keep you posted on the sameRegards,Karthik Shankaran (KS)+91-9940074724
Whats the datatype it assumes while taking the column from XML source? Have a look at data flow path from XML SOurce (duble click on it) and see the metadata definition for URL field------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 05:07:27
|
getting this error message : [Line_Raw_Data [408]] Warning: The external columns for component "Line_Raw_Data" (408) are out of synchronization with the data source columns. The external column "line_URL" needs to be updated.actually it assumed DT_WSTR 255,0 i have changed that to DT_NTEXT after which is consolidating / merging / appendhere are the error that is showing while doing the consolidation process1. [Line_Raw_Data [408]] Warning: The external columns for component "Line_Raw_Data" (408) are out of synchronization with the data source columns. The external column "line_URL" needs to be updated.2. [Line_Raw_Data [408]] Warning: The external columns for component "Line_Raw_Data" (408) are out of synchronization with the data source columns. The external column "line_URL" needs to be updated.3. [SSIS.Pipeline] Warning: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available. To resolve, run this package as an administrator, or on the system's console.4. [Line_Raw_Data [408]] Warning: The external columns for component "Line_Raw_Data" (408) are out of synchronization with the data source columns. The external column "line_URL" needs to be updated.5. [Line_Raw_Data [408]] Warning: The external columns for component "Line_Raw_Data" (408) are out of synchronization with the data source columns. The external column "line_URL" needs to be updated.6. [Line_Raw_Data [408]] Warning: The external columns for component "Line_Raw_Data" (408) are out of synchronization with the data source columns. The external column "line_URL" needs to be updated.it seems to be the same error while loading the datacan i have you contact number so that i can talk to you and see if i can get my issue resolvedRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 05:12:15
|
it ran successfully now i need to your help in getting the value1. Session ID -Autogenerated by the sql itself in all the table2. ID - Actual Session id is available in the Session_Raw_Data Table with Session_ID also available with File Name which will help me to map the correct idmy solution for this to concatenate " Session ID + " " + File Name" should be added in all the table so that i can lookup using that and put the correct ID which is Session IDRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-25 : 05:27:03
|
thats because the datatype you selected currently is imcompatible with what it set in metadata initially. double click on the xml source and it will provide you with option to fix the error automatically. Click ok and it will revert to earlier compatible type. Go to derived column add a cast expression to change column type to what you wanted.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 06:14:19
|
Hi Visakh,can i have you mobile # or can you please give me a missed call so that i can call you and fix this issue if you dont mind pleaseRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-25 : 06:18:44
|
quote: Originally posted by karmeeabi Hi Visakh,can i have you mobile # or can you please give me a missed call so that i can call you and fix this issue if you dont mind pleaseRegards,Karthik Shankaran (KS)+91-9940074724
Post your question here and I'll take a look when I've sometime------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 08:24:52
|
Hi Visakh,i have completed the XML - Consolidation / Merge / Append. now i have issue in getting the right number.1. Session ID which is present in 4 tables (Chat , REps ,Varvalues & Visitor) from the XML - which seems to be autogenerated or something which i dont know2. i have a table called Session where i have the Session Id - looks like the above mentioned "1". but i have a column called ID which is unique Session ID - now i need to map that with the above tables .thinking of this Possible SolutionSimple merge with the Reps with Session , Chat with Session , Visitor with Session & Varvalues with sessionor is there any other solution to get that dataexample of the dataAuto generated Session Id this will be in all xml file which is downloaded same number repeats + i have a derived column - File Name which will let me know which XML file is that from1 in all 5 tables92 in all 5 tables97 in all 5 tables199 in all 5 tables208 in all 5 tablesRespective ACtual Session ID from Session Table - ID but this will be unique with the File Name matched using Derived ColumnTable 1ID929572783ID929575783ID929572783ID929582783ID923572483Table 2ID922572783ID924575583ID929370773ID922585788ID913372583Table 3ID922572783ID924355583ID929890773ID924885688ID913336783Table 4ID928492783ID924355583ID929893983ID924839858ID913209633Table 5ID994952783ID924499883ID929809083ID924390958ID994059633can you please guide me to the right directionRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 09:44:46
|
Hi,i have written this in SQL but i am not too sure how to do that same in SSIS.select * into chat_1 from chat_raw_data full join session_raw_dataon (session_raw_data.session_id=chat_raw_data.session_id1) and (session_raw_data.[file name]=chat_raw_data.[file name1])SSIS1. i have tried in ssis2. Drag & Drop the Database Source - 23. right click show advance editor - is sorted = "True"4. Input and Output Properties - select the column as 15. Input and Output Properties - select the column as 2 **** Note i am trying this but unable to get it6. Merge Join Full Outer Join and clicked ok7. Destination Database created8. clicked oki am able to do that with out option 5. i dont know how to go with that.Regards,Karthik Shankaran (KS)+91-9940074724 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-25 : 10:27:09
|
Sorry I'm not getting your requirement. Are you trying to map values in four tables against that in Session table? Whats was the deal with the SessionID value from XML? I didnt get it.Can you please explain with an example? what do you mean by below?Simple merge with the Reps with Session , Chat with Session , Visitor with Session & Varvalues with sessionor is there any other solution to get that dataexample of the dataAuto generated Session Id this will be in all xml file which is downloaded same number repeats + i have a derived column - File Name which will let me know which XML file is that from1 in all 5 tables92 in all 5 tables97 in all 5 tables199 in all 5 tables208 in all 5 tables ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 13:45:06
|
now i have a different issue. i completed all the work merged the XML in one. i save my SSIS work and closed itafter i tried to open i am unable to execute it i dont know what the problem is. please help me i have done all my work.Regards,Karthik Shankaran (KS)+91-9940074724 |
|
|
karmeeabi
Starting Member
18 Posts |
Posted - 2013-06-25 : 13:46:32
|
i did save it in my desktop & share folder in my office server. both it is not working unable to execute the file not getting any error message please help me VisakhRegards,Karthik Shankaran (KS)+91-9940074724 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-26 : 02:29:40
|
Without giving any info on the error, how can anybody guess what's the issue. Atleast post the error you're getting.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Next Page
|