Require help with Pivot table query in SQL Server 2008

Hi,
I have a query regarding converting columns to rows in SQL Server 2008. Please look at the table below. 
I need the output to look something like this :
The columns for the children can be dynamic or fixed ( max of 6 children) based on the Family_ID.  For Example: A family can have 1 child or more than 1 child.
Not sure how to go about it. Would appreciate your help :)

Looks like you need dynamic pivot on multiple columns. I have two articles on this topic, start from this one
T-SQL:
Dynamic Pivot on Multiple Columns
It has reference to my other blog post.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles

Similar Messages

  • What is the best way to deal with memory leak issue in sql server 2008 R2

    What is the best way to deal with memory leak issue in sql server 2008 R2.

    What is the best way to deal with memory leak issue in sql server 2008 R2.
    I have heard of memory leak in OS that too because of some external application or rouge drivers SQL server 2008 R2 if patched to latest SP and CU ( may be if required) does not leaks memory.
    Are you in opinion that since SQL is taking lot of memory and then not releasing it is a memory leak.If so this is not a memory leak but default behavior .You need to set proper value for max server memory in sp_configure to limit buffer pool usage.However
    sql can take more memory from outside buffer pool if linked server ,CLR,extended stored procs XML are heavily utilized
    Any specific issue you are facing
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Converting MDX query into SQL Server 2008

    We have MDX query based OLAP CUbes.
    To reduce MDX based dependenies, we have to convert MDX based cube to sql server 2008 based queries.
    For this I need expert advise to convert below query to sql server 2008 based query :
    CREATE MEMBER CURRENTCUBE.Measures.[Ack Lost]
                        AS 'Sum(PeriodsToDate([Time].[Year], [Time].CurrentMember ), [Measures].[Lost])',
                        FORMAT_STRING = "#,#",
                        VISIBLE = 1;

    Hi Sachin,
    According to your description, you need to convert the MDX query to T-SQL query, right?
    Your MDX query is calculated measure that return the total value from the first sibling and ending with the given member. In T-SQL query we can use the query as Yogisha provided to achieve the same requirement. Now you need to a tool to convert all the MDX
    related SSAS cube queries to MS SQL Server 2008 based queries.
    Although MDX has some similarities with T-SQL these languages are in many ways different. Beginning to learn and comprehend SQL Server Analysis Services (SSAS) MDX queries can be difficult after one has spent years writing queries in T-SQL. Currently, there
    is no such a tool to convert a MDX query to T-SQL query since the structure difference between MDX and T-SQL. So you need to convert them manually, please refer to the links below to see the details.
    http://www.mssqltips.com/sqlservertip/2916/comparison-of-queries-written-in-tsql-and-sql-server-mdx/
    https://sqlmate.wordpress.com/2013/11/12/t-sql-vs-mdx-2/
    http://technet.microsoft.com/en-us/library/aa216779(v=sql.80).aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Isse with using Grouping Sets in SQL Server 2008 R2

    Hi,
    I created a query in SQL Server 2012 using grouping sets that works fine.  When I try to use the same query in SQL Server 2008 I get an error ("Inccorrect syntax near SETS").
    I researched using grouping sets in 2008 and didn't see any issue with my query.  What is different in grouping sets 2008 vs 2012?
    SELECT tl.ClientRegionCd as [Client Region Code] , tl.ClientRegionDesc as [Region Name], count(tl.CompleteICN) as [Trauma Letters Sent]
    from TORT_Trauma_Letters tl
    Where CONVERT(VARCHAR(26), tl.SecondNoticeSent, 23) between '2014-06-12' and '2014-06-12'
    GROUP BY GROUPING SETS((tl.ClientRegionCd, tl.ClientRegionDesc), ())
    Stacie

    Check this blog post as how to deal with date ranges
    http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/16/bad-habits-to-kick-mishandling-date-range-queries.aspx
    For your result you can simply achieve your result with UNION ALL, e.g.
    select Client, Region, Letters
    from myTable 
    UNION ALL
    select NULL, NULL, SUM(letters) as Letters
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Not getting required format with pivot table view

    Hi,
    I need to create in the bellow format...
    POD     Data     01-JAN-08     01-FEB-08     01-MAR-08     01-APR-08     01-MAY-08     01-JUN-08     01-JUL-08     01-AUG-08     01-SEP-08
    AFA     Minutes/Month     44640     41760     44640     43200     44640     43200     44640     44640     43200
         P1 Login Downtime (Min)     9     0     0     0     114     99     30     42     0
         Actual Maint Time taken (Min) 1902     2350     439     409     136     1390     51     189     400
         Availability %     99.98% 100.00%     100.00%     100.00%     99.74%     99.76%     99.93%     99.91%     100.00%
    AHA     Minutes/Month     44640     41760     44640     43200     44640     43200     44640     44640     43200
         P1 Login Downtime (Min)     9     786     99     40     64     0     0     97     134
         Actual Maint Time taken (Min)     199     2412     388     290     136     500     261     156     2688
         Availability %     99.98%     98.00%     99.78%     99.91%     99.86%     100.00%     100.00%     99.78%     99.67%
    AJA     Minutes/Month     44640     41760     44640     43200     44640     43200     44640     44640     43200
         P1 Login Downtime (Min)     39     0     0     0     30     0     30     42     2
         Actual Maint Time taken (Min)     10868     2913     426     468     1187     564     391     268     1959
         Availability %     99.88%     100.00%     100.00%     100.00%     99.93%     100.00%     99.93%     99.91%     100.00%
    ANA     Minutes/Month     44640     41760     44640     43200     44640     43200     44640     44640     43200
         P1 Login Downtime (Min)     148     52     0     13     12     0     83     92     0
         Actual Maint Time taken (Min)     1104     2155     158     2701     383     681     533     1190     765
         Availability %     99.66%     99.87%     100.00%     99.97%     99.97%     100.00%     99.81%     99.79%     100.00%
    I am able to get data in the compound table view....
    POD     Month Year     Minutes/Month     P1 Login Downtime(Min)     Actual Maint Time taken (Min)     Availability %
    AFA     1-Jan-07     44,640     0     0     100
         1-Feb-07     40,320     0     0 100
    AHA     1-Jan-07     44,640     0     0     100
         1-Feb-07     40,320     0      0     100
    But I am unable to get required formate in the pivot table view. How can I get required format in PIVOT TABLE VIEW.
    I tried in somany ways, but i am unable to adjust
    like
    AFA     Minutes/Month     44640     41760     44640     43200     44640     43200     44640     44640     43200
         P1 Login Downtime (Min)     9     0     0     0     114     99     30     42     0
         Actual Maint Time taken (Min) 1902     2350     439     409     136     1390     51     189     400
         Availability %
    Please help me on this? Is there any manuall, which can help me on this?
    Thanks alot in advance.
    Thanks
    Pathan

    Pathan,
    This can be achieved by dragging the "Measure Labels" object to the rows. Put POD and Measuers object in to the rows and months in columns.
    that will work.
    thanks
    Madan Thota

  • Tables missing in SQL Server 2008 for Hyperion Application

    Hello Experts,
    I am cuurently working on Hyperion Finacial close management (Account Reconciliation Manager) application version 11.1.2.3, O.S is Windows 2008 R2 and relational database is SQL Server 2008.
    When I am trying to copy Account Profiles to a period say go to Manage->Periods->Right Click->Copy to Periods, I get the error:
    Object arm_access is missing.
    When I open SQL server studio, I can clearly see table 'ARM_ACCESS' but when I did a search on oracle support and google, I found out that it is a case sensitive issue and the table has to be in small letters.
    So I created a new table 'arm_access' with all columns as there are in 'ARM_ACCESS' in SQL Server 2008, but it is not fetching any data.
    Can anyone provide me the query that I can run to display the same structure and data for 'arm_access'?
    If anyone is using the instance, he/she should be able to provide me the query that I can run in SQL server 2008 to populate the 'arm_access' table.
    Appreciate your help as this is stopping my development work.
    Thanks in advance.
    Regards,
    Sumit

    Hi Sumit,
    Its just a wild guess am not sure with this.
    i dont have idea about query in sql server. but it oracle it would be something like create table targettablename as select * from sourcetablename.
    Ideally it will not allow to create you a table with that name if its already exists i mean its case insensitive (. Even if you have created manually make sure the db user you created with has select privilage granted for all users or the user you configured in Financial close management) or the DB might not be having select privilage .
    Note:Have backups in place when you are manually to manipulate or changing the database user.
    Thanks
    Amith

  • Creating New db(with new name) with the old db backup sql server 2008

    Friends..
    version: Sql Server 2008
    I have a database in a name college1 (more than 200 tables and view etc...)
    i want to create a new db with all the structures including the data of the above db college1 with a new name college2
    so...i finished the step 1 successfully.. what are the other steps i have to do...like validating the invalid objects. etc....
    Step 1:
    RESTORE DATABASE college2 FROM DISK = 'D:\DailyDBbackup\college1.bak'
      WITH replace,
      move 'college2 ' TO 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\college2 .mdf',
      move  'college2 _log' TO 'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\college2 _log.ldf';
    step 2: ?
    Step 3: ?
    thanks...

    but...when i type
    use college1
    select * from (it will display all tables under the above db)
    but when i do..
    use college2
    select * from (only system tables are displaying..)
    Did restore completed successfully ? If yes Expand database , can you see tables in the new database you restored ?. Sometimes when you type incorrect word which does not matches anything you wont get help from intellicense you should not be worried about this
    if tables are there in new database college 2
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Using upgrade advisor on a database with compatibility level 80 on SQL Server 2008

    Hi All,
    My DB compatibility level is 80 which is on SqL server 2008, however I want to upgrade the database server to sql 2014. 
    Now in my case the upgrade advisor of SQL 2014 is not detecting the DB which is in 80 compatibility level and hence I cannot proceed with the upgrade (as I do not want to rollback). 
    So what exactly  can I do in this situation? any help would be appreciated
    aa

    What Olaf said Or if possible change compatibility level of database to 100 and try. I guess since you want to upgrade there wont be any issue in changing. Well if anything happens you can safely change it back to 80
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Unable to Load CSV file with comma inside the column(Sql Server 2008)

    Hi,
    I am not able load an CSV file with Comma inside a column. 
    Here is sample File:(First row contain the column names)
    _id,qp,c
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    "1","[ ""0"", ""0"", ""0"" ]","helloworld"
    When i specify the Text Qualifier as "(Double quotes) it work in SQL Server 2012, where as fail in the SQL Server 2008, complaining with error:
    TITLE: Microsoft Visual Studio
    The preview sample contains embedded text qualifiers ("). The flat file parser does not support embedding text qualifiers in data. Parsing columns that contain data with text qualifiers will fail at run time.
    BUTTONS:
    OK
    I need to do this in sql server 2008 R2 with Service pack 2, my build version is 10.50.1600.1.
    Can someone let me know it is possible in do the same way it is handle in SQL Server 2012?
    Or
    It got resolved in any successive Cumulative update after 10.50.1600.1?
    Regards Harsh

    Hello,
    If you have CSV with double quotes inside double quotes and with SSIS 2008, I suggest:
    in your data flow you use a script transformation component as Source, then define the ouput columns id signed int, Gp unicode string and C unicode string. e.g. Ouput 0 output colmuns
    Id - four-byte signed
    gp - unicode string
    cc - unicode string
    Do not use a flat file connection, but use a user variable in which you store the name of the flat file (this could be inside a for each file loop).
    The user variable is supplied as a a readonly variable argument to the script component in your dataflow.
    In the script component inMain.CreateNewOutputRows use a System.IO.Streamreader with the user variable name to read the file and use the outputbuffer addrow method to add each line to the output of the script component.
    Between the ReadLine instraction and the addrow instruction you have to add your code to extract the 3 column values.
    public override void CreateNewOutputRows()
    Add rows by calling the AddRow method on the member variable named "<Output Name>Buffer".
    For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".
    string line;
    System.IO.StreamReader file = new System.IO.StreamReader( Variables.CsvFilename);
    while ((line = file.ReadLine()) != null)
    System.Windows.Forms.MessageBox.Show(line);
    if (line.StartsWith("_id,qp,c") != true) //skip header line
    Output0Buffer.AddRow();
    string[] mydata = Yourlineconversionher(line);
    Output0Buffer.Id = Convert.ToInt32(mydata[0]);
    Output0Buffer.gp = mydata[1];
    Output0Buffer.cc = mydata[2];
    file.Close();
    Jan D'Hondt - SQL server BI development

  • Help with Inner Join query in SQL

    Hope someone can help with this, as this is quite an involved project for me, and I'm just about there with it.
    My table structure is :
    table_packages
    packageID
    package
    packageDetails
    etc
    table_destinations
    destinationID
    destination
    destinationDetails
    etc
    table_packagedestinations
    packageID
    destinationID
    ..so nothing that complicated.
    So the idea is that I can have a package details page which shows the details of the package, along any destinations linked to that package via the packagedestinations table.
    So this is the last part really - to get the page to display the destinations, but I'm missing something along the way....
    This is the PHP from the header, including my INNER JOIN query....
    PHP Code:
    <?php
    $ParampackageID_WADApackages = "-1";
    if (isset($_GET['packageID'])) {
      $ParampackageID_WADApackages = (get_magic_quotes_gpc()) ? $_GET['packageID'] : addslashes($_GET['packageID']);
    $ParamSessionpackageID_WADApackages = "-1";
    if (isset($_SESSION['WADA_Insert_packages'])) {
      $ParamSessionpackageID_WADApackages = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_packages'] : addslashes($_SESSION['WADA_Insert_packages']);
    $ParampackageID2_WADApackages = "-1";
    if (isset($_GET['packageID'])) {
      $ParampackageID2_WADApackages = (get_magic_quotes_gpc()) ? $_GET['packageID'] : addslashes($_GET['packageID']);
    mysql_select_db($database_connPackages, $connPackages);
    $query_WADApackages = sprintf("SELECT packageID, package, costperpax, duration, baselocation, category, dateadded, agerange, hotel, educational_tours, field_trips, corporate_outings, plant_visits, budget_package, rollingtours, teambuilding, description, offer FROM packages WHERE packageID = %s OR ( -1= %s AND packageID= %s)", GetSQLValueString($ParampackageID_WADApackages, "int"),GetSQLValueString($ParampackageID2_WADApackages, "int"),GetSQLValueString($ParamSessionpackageID_WADApackages, "int"));
    $WADApackages = mysql_query($query_WADApackages, $connPackages) or die(mysql_error());
    $row_WADApackages = mysql_fetch_assoc($WADApackages);
    $totalRows_WADApackages = mysql_num_rows($WADApackages);
    $colname_educationalDestinations = "1";
    if (isset($_GET['PackageID'])) {
      $colname_educationalDestinations = (get_magic_quotes_gpc()) ? packageID : addslashes(packageID);
    mysql_select_db($database_connPackages, $connPackages);
    $query_educationalDestinations = sprintf("SELECT * FROM destinations INNER JOIN (packages INNER JOIN packagedestinations ON packages.packageID = packagedestinations.packageID) ON destinations.destinationID = packagedestinations.destinationID WHERE packages.packageID = %s ORDER BY destination ASC", GetSQLValueString($colname_educationalDestinations, "int"));
    $educationalDestinations = mysql_query($query_educationalDestinations, $connPackages) or die(mysql_error());
    $row_educationalDestinations = mysql_fetch_assoc($educationalDestinations);
    $totalRows_educationalDestinations = mysql_num_rows($educationalDestinations);
    ?>
    And where I'm trying to display the destinations themselves, I have : 
    <table>
            <tr>
                     <td>Destinations :</td>
                </tr>
               <?php do { ?>
            <tr>
                 <td><?php echo $row_educationalDestinations['destination']; ?></td>
            </tr>
            <?php } while ($row_educationalDestinations = mysql_fetch_assoc($educationalDestinations)); ?>
    </table>
    If anyone could have a quick look and help me out that would be much appreciated - not sure if its my SQL at the top, or the PHP in the page, but either way it would be good to get it working. 
    Thanks.

    First off, you need to get the database tables so that there is a relationship between them.
    In fact, if there is a one to one relationship, then it may be better to store all of your information in one table such as
    table_packages
    packageID
    package
    packageDetails
    destination
    destinationDetails
    etc
    If there is a one to many relationship, then the following would be true
    packages
    packageID
    package
    packageDetails
    etc
    destinations
    destinationID
    packageID
    destination
    destinationDetails
    etc
    The above assumes that there are many destinations to one package with the relationship coloured orange.
    Once you have the above correct you can apply your query as follows
    SELECT *
    FROM packages
    INNER JOIN destinations
    ON packages.packageID = destinations.packageID
    WHERE packages.packageID = %s
    ORDER BY destination ASC
    The above query will show all packages with relevant destinations

  • Help with Pivot Table

    I'm trying to create an airplane seat map.  2 tables boarding and seats, boarding has the seat assignment (seatid) and seats has the id as well as row (eg 1) and position (eg A, B,C).  I'm trying to pivot the two together so I see which seat
    is taken and which is open (1-taken, 0-open).  Result should look like this:
    Row |A|B|C|
    ___1|1 0 1
    ___2|0 0 0
    ___3|0 0 0
    ___4|1 0 0
    Using SQL server, run a below query get error "incorrect synatx near 'PIVOT'
    SELECT *
    FROM (SELECT s.row, s.position,
    CASE when b.seatid is null
    then 0
    else 1
    end seat_free
    from seats s
    left outer join 
    boarding b 
    on (b.seatid=s.id)
    PIVOT (max (seat_free)
    FOR position in ('A' as A, 'B' as B, 'C' as C))
    Order by s.row
    Thanks for the help!

    Hi, 
    in addition to pivot solutions posted by RSingh and Latheesh, you can use another solution without pivot:
    select roww,MAX([A]) as [B],MAX([B]) as [A],MAX([C]) as [C]
    from (
    select roww ,
    [A] = CASE
    when position = 'A' and not ISNULL(boarding.seatid, '0') = '0' then 1
    else 0
    END,
    [B] = CASE
    when position = 'B' and not ISNULL(boarding.seatid, '0') = '0' then 1
    else 0
    END,
    [C] = CASE
    when position = 'C' and not ISNULL(boarding.seatid, '0') = '0' then 1
    else 0
    END
    from seat
    left join boarding on seat.id = boarding.seatid
    ) T
    group by roww
    Hope this is helpful :-)
    [Personal Site] [Blog] [Facebook]

  • Help with pivot tables in excel

    Hello,
    I need some help with a very specific issue I am getting in excel.
    So, I have this pivot table that gets data from an external source (a huge database) and everything is working fine.
    The problem comes with some lines in our database that are written in asian letters (the thai alphabet). Every thai entry that we import appears like ????????.
    I can look into the DB (via MySQL Workbench) and everything is alright in there. I can also just copy some of the content into excel and the letters shows up normally.
    Is there something I can do to fix it?
    Thank you very much
    Daniel Ayres

    I can see it is working fine for roman/latin characteres, and it is not working for thai or japanese characteres. Since I dont have data written using the russian or the arabic alphabet, there is no way I can tell you if it would or not work..

  • Required Help in Pivot Table

    Dear
    i am working on BI Publisher Desktop Version and trying to generate a RTF Template in which pivot table has to be used
    Below is the format of my XML File.
    -<G_C1>
    <R>1</R> row 1
    <C>1</C> column 1
    <C1>1300001 ASL 112531 2</C1>
    <C2>1 10 1.5</C2>
    <C3>120000105 12.5</C3>
    <C4>120000105 </C4>
    <C5>OPeration</C5>
    </G_C1>
    -<G_C1>
    <R>1</R> row 1
    <C>2</C> column 2
    <C1>1300001 ASL 112531 2</C1>
    <C2>2 10 1.5</C2>
    <C3>120000106 12.5</C3>
    <C4>120000106 </C4>
    <C5>OPeration</C5>
    </G_C1>
    -<G_C1>
    <R>1</R> row 1
    <C>3</C> column 3
    <C1>1300001 ASL 112531 2</C1>
    <C2>3 10 1.5</C2>
    <C3>120000107 12.5</C3>
    <C4>120000107 </C4>
    <C5>OPeration</C5>
    </G_C1>
    ......... and sow on till row 16 and column 8
    i am facing two issues,
    first i have to show 5 columns in cross product, but pivot table option shows option for 4 columns only
    secondly characters are not shown when i preview the template its shows 'NnN' in all columns
    Kindly help me in generating the template.
    I have to define the template in XML Publisher of Oracle E-Business Suite R12
    Regards,
    Muhammad Usman

    check these samples
    http://winrichman.blogspot.com/2008/08/pivot-table-cross-table-with-fixed.html
    and
    https://blogs.oracle.com/xmlpublisher/entry/new_skool_crosstabbing
    i will let you if i know i get anything.

  • How to improve Query performance on large table in MS SQL Server 2008 R2

    I have a table with 20 million records. What is the best option to improve query performance on this table. Is partitioning the table into filegroups  is a best option or splitting the table into multiple smaller tables? 

    Hi bala197164,
    First, I want to inform that both to partition the table into filegroups and split the table into multiple smaller tables can improve the table query performance, and they are fit for different situation. For example, our table have one hundred columns and
    some columns are not related to this table object directly (for example, there is a table named userinfo to store user information, it has columns address_street, address_zip,address_ province columns, at this time, we can create a new table named as Address,
    and add a foreign key in userinfo table references Address table), under this situation, by splitting a large table into smaller, individual tables, queries that access only a fraction of the data can run faster because there is less data to scan. Another
    situation is our table records can be grouped easily, for example, there is a column named year to store information about product release date, at this time, we can partition the table into filegroups to improve the query performance. Usually, we perform
    both of methods together. Additionally, we can add index to table to improve the query performance. For more detail information, please refer to the following document:
    Partitioning:
    http://msdn.microsoft.com/en-us/library/ms178148.aspx
    CREATE INDEX (Transact-SQL):
    http://msdn.microsoft.com/en-us/library/ms188783.aspx
    TechNet
    Subscriber Support 
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback
    here.
    Allen Li
    TechNet Community Support

  • Connecting JDBC Single Row Query to SQL Server 2008

    Hello,
    I am new to workbench and am having a very dificult time accessing a database and running a query on it. I have searched a lot on the internet for suggestion on how to accomplish this but nothing has worked. The LiveCycle was intaled on the same server that the SQL Server is sintalled, and was installed by an administrator who is no longer at our company. So I am trying to have the user input an account number into the form I have created, then take that account number and use an xpath expression to query the database and extract the information for that account. Could anyone please help me set this up.
    I Changed my my-db2-ds.xml to the following:
    <local-tx-datasource>
      <jndi-name>SQLDB_IMACS</jndi-name>
      <connection-url>jdbc:sqlserver://CBS-SQL-001;databaseName=DB_IMACS;integratedSecurity=tru e;</connection-url>
      <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    </local-tx-datasource>
    and I get the following error message:
    Exception: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: com.microsoft.sqlserver.jdbc.SQLServerDriver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: com.microsoft.sqlserver.jdbc.SQLServerDriver)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Failed to register driver for: com.microsoft.sqlserver.jdbc.SQLServerDriver; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: com.microsoft.sqlserver.jdbc.SQLServerDriver)))
    I have the following file sqljdbc.jar in my Adobe LiveCycle ES2\jboss\server\lc_turnkey\lib\ folder.
    If you could please let me know what I can do to connect that would be very useful.
    Thanks,
    sgarciacode19

    You will need to use the UNPIVOT operator:
    DECLARE @example TABLE
    Id int NOT NULL IDENTITY(1,1),
    Quantity1 int,
    Quantity2 int,
    Quantity3 int
    INSERT INTO @example VALUES (1000, 2000, 3000), (4000, 5000, 6000);
    SELECT * FROM @example;
    SELECT Id, Quantity, QuantityType
    FROM @example
    UNPIVOT
    Quantity FOR QuantityType IN (Quantity1, Quantity2, Quantity3)
    ) AS u;
    Output:
    (2 row(s) affected)
    Id Quantity1 Quantity2 Quantity3
    1 1000 2000 3000
    2 4000 5000 6000
    (2 row(s) affected)
    Id Quantity QuantityType
    1 1000 Quantity1
    1 2000 Quantity2
    1 3000 Quantity3
    2 4000 Quantity1
    2 5000 Quantity2
    2 6000 Quantity3
    (6 row(s) affected)

Maybe you are looking for

  • How to use sqlldr for loading data in Oracle 10g xe.

    I want to load data using SQL*LOADER in Oracle DB from a .csv file but it doesn't seems to be working can anyony please help me.I am not get getting how to use sqlldr. in CMD in giving this command sqlldr hr/hr control='c:/data/record.ctr' record.ctr

  • Why can't I download large files on Windows 7 in Bootcamp?

    I am running Bootcamp on a New iMac running Lion. Everything on the Apple side of my partition works brilliantly. I need Windows to run some old programs which are not available to Mac. I successfully loaded Windows 7 on Bootcamp after many attempts

  • Running Jar Files created in Sun Java Studio

    Hi everyone, I am still trying to explore the functionalities (especially as regards deployment issues) of this robust IDE. However I do have a problem. I have developed a very basic program that connects to a database (MSSQL) using Java Studio 8. Ho

  • Webservice generation

    Updating webservices from source gives me a lot of trouble ... When adding new methods to my source java code nothing happens when using regenerate from source. When adding new methods in source and manually extending the generated java interface, re

  • Slow Safari problem SOLVED

    Thanks to Klaus I was able to get my safari back up to warp 5. For the last several days it has been running quite slowly. A few days ago I tried the solution I saw posted by Mulder that had basically suggested the following 1. Quit Safari if it's ru