Combine Data In Single Row
SELECT *
FROM dbo.empBenefits q
WHERE (StartDate IN
(SELECT TOP 2 STARTDATE
FROM EMPBENEFITS
WHERE EMPBENEFITS.employeeno = q.employeeno AND Benefitcode = 'HON'
ORDER BY startdate ASC))
I have this select statement working however I need to combine 2 records in a single row in a single table. The unique key is Employee No.
View Complete Forum Thread with Replies
Related Forum Messages:
Combine Data In Single Row From Single Table
How can i combine my data in single row ? All data are in a single table sorted as employeeno, date Code: Employee No Date SALARY 1 10/30/2006 500 1 11/30/2006 1000 2 10/25/2006 800 3 10/26/2006 900 4 10/28/2006 1000 4 11/01/2006 8000 Should Appear Code: EmployeeNo Date1 OLDSALARY Date2 NEWSALARY 1 10/30/2006 500 11/30/2006 1000 2 10/25/2006 800 3 10/26/2006 900 4 10/28/2006 1000 11/01/2006 800 PLEASE HELP I REALLY NEED THE RIGHT QUERY FOR THIS OUTPUT. THANKS IN ADVANCE
View Replies !
Combine Multiple Records Into Single Row
This is how the data is organized:vID Answer12 Satisfied12 Marketing12 Yes15 Dissatisfied15 Technology15 No32 Strongly Dissatisfied32 Marketing32 YesWhat I need to do is pull a recordset which each vID is a single rowand each of the answers is a different field in the row so it lookssomething like thisvID Answer1 Answer2 Answer312 Saitsfied Marketing Yesetc...I can't quite get my mind wrapped around this one.
View Replies !
Can We Combine These 3 Statements Into One Single Query
SELECT 1 as id,COUNT(name) as count1 INTO #temp1 FROM emp SELECT 1 as id,COUNT(name) as count2 INTO #temp2 FROM emp WHERE name <>' ' AND name IS NOT NULL OR name <> NULL SELECT (cast(b.count2 as float)/cast(a.count1 as float))*100 AS per_non_null_names FROM #temp1 a INNER JOIN #temp2 ON a.id=b.id
View Replies !
Script To Combine Multiple Rows Into 1 Single Row
Hi,I'm working on a system migration and I need to combine data from multiplerows (with the same ID) into one comma separated string. This is how thedata is at the moment:Company_ID Material0x00C00000000053B86 Lead0x00C00000000053B86 Sulphur0x00C00000000053B86 ConcreteI need it in the following format:Company_ID Material0x00C00000000053B86 Lead, Sulphur, ConcreteThere is no definite number of materials per Company.I have read the part ofhttp://www.sommarskog.se/arrays-in-sql.html#iterative that talks about 'TheIterative Method' but my knowledge of SQL is very limited and I don't knowhow to use this code to get what I need.Can anyone help me?
View Replies !
Script To Combine Multiple Rows Into A Single Row
Hi everyone,I really appreciate if anyone could help me with this tricky problemthat I'm having. I'm looking for a sample script to combine data inmultiple rows into one row. I'm using sqlserver. This is how data isstored in the table.ID Color111 Blue111 Yellow111 Pink111 GreenThis is the result that I would like to have.ID Color111 Blue, Yellow, Pink, GreenThere is no definite number of colors per ID. I have to use ID togroup these colors into one row. Therefore, ID becomes a unique keyin the table.Appreciate your help and time. Thank you in advance
View Replies !
Combine Multiple Rows Into Single SQL Record
Hello: I have the following table. There are eight section IDs in all. I want to return a single row for each product with the various section results that I have information on. productID SectionID statusID 10 1 0 10 2 1 10 3 2 10 4 1 10 5 3 10 6 1 11 1 0 11 2 1 11 3 2 11 7 3 11 8 3 Need to return two rows with the respective values for each section. productID section1 section2 section3 section4 section5 section6 section7 section8 10 0 1 2 1 3 1 11 0 1 2 3 3 Any information or if you can point me in the right direction would be appreciated. Thanks
View Replies !
How Can I Combine Values Of Multiple Columns Into A Single Column?
Suppose that I have a table with following values Table1 Col1 Col2 Col3 ----------------------------------------------------------- P3456 C935876 T675 P5555 C678909 T8888 And the outcome that I want is: CombinedValues(ColumnName) ---------------------------------------------- P3456 - C935876 - T675 P5555 - C678909 - T8888 where CombinedValues column contains values of coulmn 1,2 & 3 seperated by '-' So is there any way to achieve this?
View Replies !
How To Combine OLAP Data With Relational Data
Can anyone point me in the right direction please. I have built a cube with sales data, by week, product and branch. I want to create a report which has the last 5 weeks sales, with the current stock from the main relational database. I can't seem to find any method of doing this. Am I just thick?
View Replies !
Combine Data Into One Row, Add Columns
Hey guys, I realize I've posted something like this before, but i'm confused how to do something new, what I am trying to do is combine rows of data when certain columns equal one another. For example, I have to sets of data who have in common the columns ctp_code and a mod_code (they are the same) however they have two other columns called billing_amt and amount_owed that need to be added together (literally taking the data and doing the math, so 100.00 + 100.00 = 200.00) Code: id ctp_code mod_code billing_amt amount_owed 1 1 1 100.00 100.00 2 1 1 100.00 100.00 My results should be this: Code: id ctp_code mod_code billing_amt amount_owed 1 1 1 200.00 200.00 Any help, thoughts?
View Replies !
Getting Data And Combine Two Column
I have a table Table, there are two set of Number and store in Tel1 and Tel2 I want to get all the number of each reacod that start with '1' on each record, the number I need that may in Tel1 or Tel2, I want to get the result like 'Result' table how can I do it ? THX TableA +----+-------+-------+ | ID | Tel1 |Tel2 | +----+-------+-------+ | 1 | 12223 | 92269 | | 2 | 12269 | 97789 | | 3 | 96636 | 13369 | | 4 | 12259 | 97781 | | 5 | 92889 | 12263 | +----+-------+-------+ Result +----+-------+ | ID | Tel | +----+-------+ | 1 | 12223 | | 2 | 12269 | | 3 | 13369 | | 4 | 12259 | | 5 | 12263 | +----+-------+
View Replies !
How To Combine Date And Time Before Import Data?
I have extracted the data from Point of Sales. it has two columns one for date and one for time in the database. I need to combine both column into single column with the format "mm/dd/yyyy hh:mm:ss" before i import the data into the SQL server for my BI project. Example: Data extract from Point of Sales FDATEFTIME 20060114063616 20060115070743 20060116071020 How can i combine those two when i import into SQL server like below: FDATE 01/14/2006 06:36:16 01/15/2006 07:07:43 01/16/2006 07:10:20 million thanks.
View Replies !
Need To Combine String Data From Multiple Columns Into One Column
When quering a table with given criteria, For ex: select notes, jobid, caller from contact where status in (6) and jobid = 173 I am getting this: This job will be posted to Monster for 2 weeks. 173 906 Waiting for full budget approval 173 906 TUrns out we're uppin 173 906 What should I do so that these three columns for the same jobid from the same caller appears in only one column, either separated by a comma or semicolon? Please HELP!!!!!
View Replies !
Combine Tables From 2 SQL Servers With Different Schemas And Update As New Data Is Entered
I have 2 SQL server 2000 machines, I need to take a table from each one and combine them together based on a date time stamp. The first machine has a database that records information based on an event it is given a timestamp the value of variable is stored and a few other fields are stored in Table A. The second machine Table B has test data entered in a lab scenario. This is a manufacturing facility so the Table A data is recorded by means of a third party software. Whenever a sample is taken in the plant the event for Table A is triggered and recorded in the table. The test data may be entered on that sample in Table B several hours later the lab technician records the time that the sample was taken in Table B but it is not exact to match with the timestamp in Table A. I need to combine each of these tables into a new SQL server 2005 database on a new machine. After combining the tables which I am assuming I can based on a query that looks at the timestamp on both Tables A & B and match the rows up based on the closest timestamp. I need to continuously update these tables with the new data as it comes in. I havent worked with SQL for a couple of years and have looked at several ways to complete this task but havent had much luck. I have researched linked servers, SSIS, etc Any help would be greatly appreciated.
View Replies !
Combine Data And Split Into Separate Txt Files For Each Header/detail Row Groupings
I€™ve created with the help of some great people an SSIS 2005 package which does the follow so far: 1) Takes an incoming txt file. Example txt file: http://www.webfound.net/split.txt The txt file going from top to bottom is sort of grouped like this Header Row (designated by €˜HD€™) Corresponding Detail Rows for the Header Row €¦.. Next Header Row Corresponding Detail Rows €¦and so on http://www.webfound.net/rows.jpg 2) Header Rows are split into one table, Maintenance Detail Rows into another, and Payment Detail Rows into a third table. A uniqueID has been created for each header and it€™s related detail rows to form a PK/FK relationship as there was non prior to the import, only the relation was in order of header / related rows below it when we first started. The reason I split this out is so I can massage it later with stored proc filters, whatever€¦ Now I€™m trying to somehow bring back the data in those table together like it was initially using a query so that I can cut out each of the Header / Detail Row sections into their own txt file. So, if you look at the original txt file, each new header and it€™s related detail rows (example of a cut piece would be http://www.webfound.net/rows.jpg) need to be cut out and put into their own separate txt file. This is where I€™m stuck. How to create a query to combine it all back into an OLE DB Souce component, then somehow read that souce and split out the sections into their own individual txt files. The filenames of the txt files will vary and be based on one of the column values already in the header table. Here is a print screen of my package so far: http://www.webfound.net/tasks.jpg http://www.webfound.net/Import_MaintenanceFile_Task_components.jpg http://www.webfound.net/DataFlow_Task_components.jpg Let me know if you need more info. Examples of the actual data in the tables are here: http://www.webfound.net/mnt_headerRows.txt http://www.webfound.net/mnt_MaintenanceRows.txt http://www.webfound.net/mnt_PaymentRows.txt Here's a print screen of the table schema: http://www.webfound.net/schema.jpg
View Replies !
Selecting A Single Data Source From Multiple Data Sources
Hi, I am pretty new to SSIS. I am trying to create a package which can accept data in any of several formats. i.e. CSV, Excel, a SQL Server database/table and import the data into my destination database. So far i've managed to get this working OK. However I am now TOTALLY stuck. I'm currently trying to just concentrate on the data sources being a CSV (using a Flat File Data Source) and/or an Excel Spreadsheet. I can get the data in and to my destination using a UNION ALL component and mapping the data sources to it so long as both the CSV file and the Excel spreadsheet exist. My problem is that I need my package to handle the possibility that only the CSV file might exist and there is no Excel spreadsheet. In which case i'd like the package to ignore the Excel datasource completely. Currently either of my data sources do not exist I get errors and the package terminates. Is there any way in SSIS that I can check all my data sources to see which ones exist (i.e. are valid). If they exist I want to use them. If it doesn't exist i'd like to disgard it (without error - as long as there is a single datasource the package should run) I've tried using the AcquireConnection method in a script task on each of my connections, hoping that it would error if the file/datasource did not exist. It doesn't though (in the case of an Excel datasource it just creates a empty excel file for me). The only other option I can come up with are to have seperate packages depending on the type of data we want to import and then run a particular package depending on the format of the source data. This seems a bit long winded. I am pretty sure I must be able to do what I want to achieve but I can't work out how. I'll be grateful to anyone who can send me any tips/hints/links on how I can achieve this. Many thanks Rob Gibson
View Replies !
Error Writing Data To Same Destination In Single Data Flow
I am getting the following error running a data flow that splits the input data into multiple streams and writes the results of each stream to the same destination table: "This operation conflicts with another pending operation on this transaction. The operation failed." The flow starts with a single source table with one row per student and multiple scores for that student. It does a few lookups and then splits the stream (using Multicast) in several layers, ultimately generating 25 destinations (one for each score to be recorded), all going to the same table (like a fact table). This all is running under a transaction at the package level, which is distributed to a separate machine. Apparently, I cannot have all of these streams inserting data into the same table at one time. I don't understand why not. In an OLTP system, many transactions are inserting records into the same table at once. Why can't I do that within the same transaction? I suppose I can use a UnionAll to join them back together before writing to a single destination, but that seems like an unnecessary waste and clutters the flow. Can anyone offer a different solution or a reason why this fails in the first place? Thanks in advance.
View Replies !
Grouping By One Field And Combine Data Of Another Field In SSRS
Hi all experters, Please suggest how to build the report in below case: Raw data: ID Member Functions 1 Alan A 1 Alan B 2 Tom A 2 Tom B 2 Tom C 3 Mary D 3 Mary E Report Shows: ID Member Functions 1 Alan A,B 2 Tom A,B,C 3 Mary D,E I group the data by the column ID, but would like to show the functions data by join all functions' values by the same ID. Any good suggestion? Thanks in advance, Steve Wang 2008/4/2
View Replies !
Xml Data Transformation Into Single Data Row
Im attempting to put data from an xml file (formatting like its different tables) into a database table as a single data row entry. I've attempted to use the 'union all' and 'merge' transformation but this inserts the data as multiple rows. Is this possible ?.
View Replies !
Column Data In The Single Row
Hi, I have a table such as ID Name OS ---------------------------------- 10 Paul AIX 10 Paul SOLARIS 10 Paul NT 20 Jack NT 20 Jack SOLARIS and I have asked to create an output as ID NAME OS ----------------------------------- 10 Paul AIX,SOLARIS,NT 20 JAck NT,SOLARIS How can I get this output via sql. Also a good source for such tricky SQLs would be very fruity.
View Replies !
Get Data From Query In Single Row
Hello All, I have following type of table with data. Year id value 01-01-2008 123 10 01-01-2008 131 11 01-01-2008 139 132 01-01-2007 153 112 01-01-2007 154 134 01-01-2007 155 164 I want to write query such that I should get value of particular year in single row as follows Date Col 1 Col 2 Col 3 01-01-2008 10 11 132 01-01-2007 112 134 164 How can I write this type of query ? Please do let me know if anyone know how to write it ? Thanks in advance. --kneel
View Replies !
To Store Data With Single Quote
HI,I anm geting error when i want to store some text which contens single quote like this Hi I am 'santosh'.as i am using text editor which genetates XML data (not pure) so i have used varchar(max) to store the data but it gives error. Is thier any way to store text with single quote........ urgent plz.
View Replies !
Using Single Apostrophe While Inserting Data
Dear fellows, I want to insert the data in a field which contains apostrophe['] in it, but the insert command does not stores the test after apostrophe e.g Insert into test_tbl(id,name) values (32,'This is a test of apostrophe's ...'); the above command does not store after first apostrophe. Please suggest -Faisal
View Replies !
Using Multiple Data Sources For Single..
Hi, I am new to Reporting Servies. I need to create a report that is shared by different offices, each office has it own database. So I will need to include multiple data sources. I want users to select their office first (parameter) and then based on their selection they can see the report with the data source from their office. Can I do it in one report. Or do I have to create multiple version of same report for each office. I would appreciate any help. Regards, Hasn
View Replies !
Summarize Data Using Single Query
I recieve duplicate customer bill data which I want to consolidate using SQL query. How to summarize data using single query...both Qty and Price. If either one of price or qty is -ve then both should be -ve. Here is example data for one customer. 1 €“ Only Qty is negative Product Qty Price Shirt 2 6.00 Shirt -1 6.00 ------------------------------------------------------------------------------------------------- Shirt 1 6.00 Result 2 - Only price is negative Product Qty Price Pant 2 6.00 Pant 1 -6.00 ------------------------------------------------------------------------------------------------- Pant 1 6.00 Result Thanks for help!! Pintoo
View Replies !
Adding Multiples Data In Single Post
I have 3x6 textbox lay out, QTY, Descp, Cost, with submit button with followin code...., insert function has too many function, anyone know how to work thiis type of data entery?? Thanks in advanc.Dim Quntityx() As Integer = {txtQ1.Text, txtQ2.Text, txtQ3.Text, txtQ4.Text, txtQ5.Text, txtQ6.Text} Dim xDex() As String = {txtD1.Text, txtD2.Text, txtD3.Text, txtD4.Text, txtD5.Text, txtD6.Text}Dim xcost() As Decimal = {txtC1.Text, txtC2.Text, txtC3.Text, txtC4.Text, txtC5.Text, txtC6.Text} Dim i As IntegerFor i = 0 To 5 itemInput.InsertParameters.Add("RequestN", RequestN)itemInput.InsertParameters.Add("Description", xDex(i)) itemInput.InsertParameters.Add("Cost", xcost(i))itemInput.InsertParameters.Add("Quantity", Quntityx(i)) itemInput.Insert(i) Next i
View Replies !
Linq To Sql: Single() And No Data To Return -&> InvalidOperationException :-(
example: int countryid; try { country = context.databasetable.Single(c => c.country == attributes["Country"]).id; } catch (InvalidOperationException ioEx) { System.Diagnostics.Debug.WriteLine(ioEx.Message); country = 0; } In my scenario an empty result is valid. Why doesn't linq just set country to "0"? I tried the same thing with Nullable Types, too.var country = context.databasetable.Single(c => c.country == attributes["Country"]);This should be nullable.. still it causes the same exception if there's no data to return. Trying and Catching does work.. but I believe that's not exactly the way to go here. Any recommendations? Maybe Single() is not the right choice? regards
View Replies !
Retrieving Hierarchical Data From A Single Table
I would like to retrieve a hierarchical list of Product Categories from a single table where the primary key is a ProductCategoryId (int) and there is an index on a ParentProductCategoryId (int) field. In other words, I have a self-referencing table. Categories at the top level of the hierarchy have a ParentProductCategoryId of zero (0). I would like to display the list in a TreeView or similar hierarchical data display control.Is there a way to retrieve the rows in hierarchical order, sorted by CategoryName within level? I would like to do so from a stored procedure. Example data:ProductCategoryID CategoryDescription ParentProductcategoryID ParentCategoryDescription Level------------------------------------------------------------------------------------------------------------------------------------------------1 Custom Furniture 0 02 Boxes 0 03 Toys 0 04 Bedroom 1 Custom Furniture 15 Dining 1 Custom Furniture 16 Accessories 1 Custom Furniture 17 Picture Frames 6 Accessories 28 Serving Trays 6 Accessories 29 Entertainment 1 Custom Furniture 110 Planes 3 Toys 111 Trains 3 Toys 112 Boats 3 Toys 113 Automobiles 3 Toys 114 Jewelry 2 Boxes 115 Keepsake 2 Boxes 116 Specialty 2 Boxes 1Desired output:Custom Furniture Accessories Picture Frames Serving Trays Bedroom Dining EntertainmentBoxes Jewelry Keepsake SpecialtyToys Automobiles Boats Planes Trains
View Replies !
How To Retrive Single Data From Sqldatasource Control
hi, i need to code for retrieving single data from sqldatasource control. i need the full set of coding connecting retrieving data in text box editing data to the table updating data to the table deleting data to the table i want to fetch "single field data" any one who know the code please post reply or send it to my mail senthilonline_foryou@rediffmail.com
View Replies !
Help With Creating SQL Statement To Get Data From Single Table...
Hi, I'm having some difficulty creating the SQL Statement for getting some data from a table: I have the following table of data __User___Votes___Month __A_______14______2__A_______12______3__A_______17______4__A_______11______5 __B_______19______2__B_______12______3__B_______15______4 I want to beable to pull out the total number of votes a user has had over a period of months. eg Total up each users users votes for months 4 and 5 that would give: __User____TotalVotes ___A________28___B________15 An added complecation is that user B does not have any data for month 5 Any help or pointers would be fanstatic Many thanks
View Replies !
Split A Single Column Data In To 2 Columns
Hi This is probably a very basic question for most people in this group. How do i split the data in a column in to 2 columns? This can be done in access with an update query but in MS SQL server I am not sure. Here is an example of what i want to acheive FName John?Doe FName LName John Doe thanks for the help prit
View Replies !
DTS Transformation Of Multiple Data In Single Fields
I have a very complex (for me, anyway) data transformation problem. I've been given a flat-file of physician data from another system which must be automated for entry into the SQL server on a regular basis. This was no problem until we discovered that several fields (all of which we wanted to use) had multiple pieces of information in them, separated by semicolons. Well, this didn't seem to be too big of a problem, so I wrote a DTS activeX script to handle it. This is what I originally wrote: '******************* Function Transform() 'Declare variables Dim strOffice Dim strOfficeNew Dim cChar Dim x Dim y Dim z 'Scrub values into new rows strOffice = DTSSource("Col050") x = 1 y = len(strOffice) z = 1 While x <= y cChar = Mid(strOffice, x 1) If cChar <> ";" Then strOfficeNew = strOfficeNew & cChar Else DTSDestination("Phys_No") = DTSSource("Col001") DTSDestination("Addr_No") = z DTSDestination("Addr_Office") = strOfficeNew strOfficeNew = "" z = z + 1 End If x = x + 1 Wend 'Insert final record after last semicolon If strOffice <> "" Then DTSDestination("Phys_No") = DTSSource("Col001") DTSDestination("Addr_No") = z DTSDestination("Addr_Office") = strOfficeNew End If Transform = DTSTransformStat_OK End Function '********************* This, of course, didn't work. WHat I got was the last part of the parsed data, which for the first record, was the second Address in the field. I searched around, and found the following script that is supposed to allow multiple rows off of a single row, but I can't seem to merge the two and still get the data out clean. '********** Dim nCounter nCounter = 4 Function Main() if nCounter > 0 then Main = DTSTransformStat_SkipFetch DTSDestination("PatientNumber") = DTSSource("PatientNumber") Select Case nCounter Case 1 DTSDestination("PhysicianType") = "Admitting" DTSDestination("PhysicianId") = DTSSource ("AdmittingPhysician") Case 2 DTSDestination("PhysicianType") = "Attending" DTSDestination("PhysicianId") = DTSSource ("AttendingPhysician") Case 3 DTSDestination("PhysicianType") = "Referring" DTSDestination("PhysicianId") = DTSSource ("ReferringPhysician") Case 4 DTSDestination("PhysicianType") = "Consulting" DTSDestination("PhysicianId") = DTSSource ("ConsultingPhysician") End Select nCounter = nCounter - 1 else nCounter = 4 Main = DTSTransformStat_SkipInsert end if End Function '************** I'm not a VB Script expert, so there's probably something very simple that I'm missing here... if someone could point it out, I'd be greatly appreciative. Jaysen
View Replies !
Single Report Multiple Data Sources
I have multiple data sources that I would like to use for a single report. The data sources are separate due to security requirements. I have a table that I can get the Initial Catalog from. How do I get that field from the database into the data source connection string at run time? I saw this link here but the light bulb didn't go off: http://technet.microsoft.com/en-us/library/ms156450.aspx "define a query that retrieves a list of data sources at run time" Can somebody help me out here? TIA, Darren
View Replies !
Using Multiple Data Sources In Single Report.
I am using SQL RS 2005. I have a report that is using multiple data sources from different offices. I can add these data sources in my report but is it possible that I can select a specific data source based on a selected parameter value. In this case user from each office, select their office location and be able to see the data from their office. I would appreciate any suggestions. Sal
View Replies !
Displaying Data In Hierarchy From Single Table..
Hi, I like to get data from a signle table and arranged in hierarchical(hierarchy) order. What will be my sql script to be able to get the desired result shown below? Please include some explanation as too what script is doing.. Table Structure and Sample Data Id ParentId Name Code DisplayOrder 1 null Group 1 G00001 1 2 null Group 2 G00002 2 3 1 Sub-Group 1 SG0001 1 4 2 Sub-Group 2 SG0002 1 5 3 Sub-Sub-Group 1 SSG001 1 6 null Group 3 G00003 3 7 3 Sub-Sub-Group 2 SSG002 2 Desired Result Id ParentId Level Name ExtendedName DisplayOrder 1 null 1 Group 1 Group 1 1 3 1 2 Sub-Group 1 Group 1 -> Sub-Group 1 1 5 3 3 Sub-Sub-Group 1 Group 1 -> Sub-Group 1 -> Sub-Sub-Group 1 1 7 3 3 Sub-Sub-Group 2 Group 1 -> Sub-Group 1 -> Sub-Sub-Group 2 2 4 2 2 Sub-Group 2 Group 1 -> Sub-Group 2 1 2 null 1 Group 2 Group 2 2 6 null 1 Group 3 Group 3 3
View Replies !
Single Report With The Data From &&"Multiple Data Sources&&"
Hi, In my project i want a report. In that report data is getting from more than one data sources(systems). While creating data source view i used named query for both primary and secondary data source. But at the time of crating "Report Model" i am getting below error. An error occurred while executing a command. Message: Invalid object name 'Table2'. Command: SELECT COUNT(*) FROM (SELECT SerialNum, ModelNum AS com_model FROM Table2) t Is there any way to create a report with multiple data sources?
View Replies !
Read Single Piece Of Data From SqlDataSource To A Variable?
First I want to say thanks to the folks how have helped me over the past week or two. I'm missing a crucial piece of insight. How do I read a single piece of data from a SqlDataSource which only hold one row of data into a declared variable? string zUserName = SqlDataSource.(get the value in the row that is labeled UserName) It really doesn't matter to me whether it is an SqlDataSource or some other data container that hold the data I've selected. My goal is to be able to read some data from some predefined datasource into a declared variable. If I am approaching this problem in the wrong way any advice or article links you could give me would be grealy appreciate. Thanks, Bill
View Replies !
Comparing Data In Two Consecutive Rows From A Single Table
I'm trying to come up with an elegant, simple way to compare twoconsecutive values from the same table.For instance:SELECT TOP 2 datavalues FROM myTable ORDER BY timestamp DESCThat gives me the two latest values. I want to test the rate ofchange of these values. If the top row is a 50% increase over the rowbelow it, I'll execute some special logic.What are my options? The only ways I can think of doing this arepretty ugly. Any help is very much appreciated. Thanks!B.
View Replies !
Aggregate Function To Concatenate Columns Data Into A Single Row
Hi all, I have a scenario which I am not able to figure out how to do it better for quite some time. Assume I have a few rows of data : RunningID Date WOid 1234 1/23/2007 23 1236 1/24/2007 23 1239 1/2/2007 24 1222 1/4/2007 23 1321 2/4/2007 22 My objective is to merge all RunningID into a single cell when WOid is the same (this will most probably use a "group by" to get the different WOid out). Maybe some aggregate function that can do it as: select ReturnConca(RunningID, "#") as RunningID_str, max(Date) as MaxDate, max(WOid) as WO from tableXXX group by WOid Results: RunningID_str MaxDate WO 1234#1236#1222 1/24/2007 23 1239 1/2/2007 24 1321 2/4/2007 22 Any advise would be much appreciated.
View Replies !
Putting Multiple Xml Files Data Into Database In A Single Transaction
First of all i do not know whether this is the right form to ask the question Let me describe the scenario iam using Iam generating xml files at a particular place and sending them to a server xml1|--------------------->dataset1------------------------------>adapter1.update(dataset1)xml2|----------------------->dataset2----------------------------->adapter2.update(dataset2)xml3|----------------------->dataset3------------------------------>adapter3.update(dataset3) all the three updates should happen in only one transaction if any one of the update fails then the transaction should rollbackcan anyone tell me a way to do iti am desperately in search of any ways to do it can anybody help please
View Replies !
Writing Data From Multiple Tables To A Single Flat File
I have a package that contains three database tables (Header, detail and trailer record) each table is connected via a OLE DB source in SSIS. Each table varies in the amount of colums it holds and niether of the tables have the same field names. I need to transfer all data, from each table, in order, to a flat file destination.
View Replies !
Loading The Different Language Data From Excel File To The Single Table
can anyone help me to solve this problem i have created a ssis package to load the data from excel file to the table, but we are getting the data in different language ie in french,english and in china after loading the data when we view the data it is showing as junk characters for chinese data but we are able to see other language data ie french and english. so please tell me how to solve that reply to my mail id(sandeep_shetty@mindtree.com)
View Replies !
|