.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

move table from excel to sql in pivot format.

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :Sql Server

Hi All, i have a table in excel as follows and i want to move all records from excel to sql but in pivot format.

field 1              S5803                      S5597                  S5825

A002             S5803_v12009       S5597_v12009        S5825_v12009

-----               --------------           -------------              --------------

and the table i want in sql as :

Code          Contract         MaterialCode

A002             S5803          S5803_v12009

A002             S5597       

View Complete Post

More Related Resource Links

Pivot table format reset after refreshment in excel 2007



i create an excel 2007 sheet that contains a pivot table which reads from my AS cube, and i format that pivot table with special formats like adding borders and changing some colors, ... and so.


the next time i need to refresh the pivot table data and when i do so all my formats is reset.


what should I do to disable this functionality ?





Heba El-Desouky

Excel 2007 Pivot table OLAP- SSAS 2008 Error

Hi, I do have a strange issue with Excel 2007 pivot table report; the data source is SSAS 2008 cube. When refresh the excel 2007 report data using the 'Refresh All' or 'Refresh' button available under the Data menu, the below error is thrown. "The expression contains a function that cannot operate on a set with more than 4,294,967,296 tuples." After some analysis, the report works well on the below workaround, 1. Remove all the calculated measures from report (3 measures in this scenario) 2. Remove one row label (dimension attribute) from report But the measures, attributes are valid one from cube and it is required fields in the report. So, understand that removing few items is not at all a solution. The below workaround also works. 1. Check the 'Defer Layout Update' option from the Pivot Table Field List window. 2. Click on the Update button After that Unchecked the 'Defer Layout Update' option and apply the filter, etc in the report. The report works very well. But every time, we need to use the above work around after open the excel report. I have NO clue on this issue. Please help to resolve this issue. Thanks, Jey

Excel 2003 pivot table - parent showing grand total than the sum of its children

All, In Excel 2003, I have a product hierarchy, for simplistic sake lets say it goes A > B > C > model nbr.  I have filtered on model nbr 1.  I have the product hierarchy in my pivot table and unit cnt as the measure. Starting at level A in the hierarchy I am showing a total unit of 12000, if I drill down to B it still shows 12000, if I drill down to C it shows 100 and if I drill down to model nbr it shows me model nbr 1 with a unit cnt of 100. So my question is why are my parents not filtering the model nbr, it is taking the total for ALL records that have level A as their parent regardless of the model nbr? This does NOT happen in Excel 2007 or when I browse my cube in SSAS.

How to change connection string of a pivot table pointing to SSAS 2005 cube using excel 2003?

Hi All,I am not sure if I should have posted this query to Excel 2003 forum. But posting it here as it applies to SSAS 2005 as well.Ok, let me give the background before I tell the actual problem.We have users on ABC domain and the SSAS server is also on ABC domain. Users on this domain can acess the excel pivots by connecting to cube to browse the data. They leave the Userid & password field blank while they setup the connection string and it works fine. Thanks to windows authentication that takes the credentials of user logged in. Let's say I have two users A and B, they login to ABC domain with their own windows ids.  Now when user A creates a excel file having a cube pivot and then sends this file to user B, user B can refresh and modify the same excel file (he can select new measures to pivot, new hierarchies in filters and so on).Now, let's say I have another user, user C. He has excel 2003 installed on his PC and cannot migrate to excel 2007. He is on different domain XYZ but have a valid windows userid on domain ABC. The domain ABC & XYZ can not be setup to have trusted relationship. Now, when user A sends the same excel file to user C. When user C opens the file and try to refresh it or try to modify the pivot by selecting/deselecting any elements, he gets below error prompt:" An error was encountered in the transport layer." and "Errors in the

Excel pivot table report filter selections from a cube

There are two filters added to the report filter, Date (8/31/2010) and Product (Product A), from a cube I have.  Everything works just fine.  Once the cube is refreshed each day to include the new data, for some reason, only the selection of Date, 8/31/2010, stays but the selection of Product changes to All Products.  Both dimensions are fully processed but the surrogate keys for existing records do not change.  I checked the MDX captured in Profiler and in the where clause, the date selection is passed from the pivot table but the product selection is lost and all products is passed in.  Any thoughts? TIA. 

SSAS 2008 R2 Cube being queried by Excel 2010 Pivot Table - 60x slower than with Excel 2003!


SQLServer 2008 R2

Excel 2010 x64

Hi All,

I have a fairly complex Excel report where a raw data sheet is updated from 10 or so PivotTables pulling from an Analysis Services Cube, (2008 R2), with a VBA script that refreshes all pivottables, and then does some post-processing, formatting etc.

This was originally developed in Excel 2003, and the updating of all the pivot tables ran in under 10 seconds

I've now recreated in Excel 2010 and *each table* is taking up to a minute to refresh!

I've also observed that I can get the refresh time of a single table back down to 1sec, if I delete all other pivottables from the worksheet/book.

Its deeply frustrating, as I'm touting 2010 as being the way for our business to go...it won't help the cause if I deliver something with a x60 increase in runtime!

I've run traces of both the 2003 and 2010 versions executing against the SQL Server, the only thing I can see is that the 2003 version passes 1 single MDX query, whilst the 2010 version appears to be firing it in sections.

I've posted this in the Excel forum too.

Please can anyone help?

Many thanks,





Excel pivot table



I have an Excel file with Pivot Table connected to MS SQL Analysis Services.

Is it possible to programmatically get this Pivot table (refreshed data) and save it as image (gif, wmf, emf, etc)


Analysis Services 2008 e Excel pivot table: different filters for each column


I have to create a report in excel 2010 based on a  analysis services 2008 cube.

I created a pivot table that contains four columns containing the elements of a hierarchy. My problem is that each column should be filtered with different values of the same field.

For example: given a hierarchy that describes me a set of products, I have to filter the product for customer  1 and 3, Product B for  customer 2 and the product C for the customer 3.

I think this thing is not possible in Excel (right?)

So I decided to use a mdx script to filter each product 

I tried so (for example, product A):
scope (descendants([Products].[products].[liv0].&[A], 1, leaves));
[Measures].Quantity = sum({[Customer].[Code].&[01], [Customer].[Code].&[03]}, [Measures].quantity);
end scope;

I still get an error of infinite recursion. How can I solve my problem? Is there a better system than what I am following?

How to automatically refresh pivot table in excel web access?



I have created UDF which takes parameters and returns data from the SQL back end. On the data returned to excel, i have created a pivot table and pivot chart. When i pass in the parameter from excel web acess, the data in the pivot table and chart dosent gets refreshed until i click on "Refresh All Connection" in excel web access webpart. Is it possible to refresh the pivot table automatically wheh i pass in the parameters from excel web access webpart?


SQL 2008 Pivot using vertical and hortizonal format table



I have 2 tables, where one holds Name and address information in a wide format, second table is a deep version where i have the records with field names (i.e. Date Of Birth) in the value and then another field with the actual value.

I need to merge both tables together to create a new 3rd table and have everything in a wide format, so name and address for one record plus another new column with Date of Birth, so in the end i would just have one row for a person.

i am using sql 2008, i have a very large dataset so need something generic and fast as there are lots of different field names so i would need to add this to the new table as well. The number of fields is not consistent, so need to create this dynamicaly, I also need to run in small batches as the selection causes space issues.

declare @fieldNames varchar(max)
set @fieldNames = stuff((select distinct ',' + incomingfieldName from tmp_other for xml path('')),1,1,'')
declare @sql nvarchar(max)

declare @BatchSize int, @MaxID int, @Iterations int, @I int
set @BatchSize = 10000 -- 1K records at once
select @MaxID = max(Purn) from Tmp_Rank -- get maximum number
set @Iterations = ceiling(@MaxID/@BatchSize) -- this will give us number of iterations to perform.
print 'MaxID: ' + convert(varchar(10),@MaxID) + ' Batch Size:

With Excel pivot table client using SSAS cube, how to change the measures to rows?

I want the measures as rows instead of columns in Excel pivot table on a SSAS 2008 cube. How do I do that? Thanks.

Users use Excel-Pivot table to query the cube, how to capture those queries?


Most of our users use Excel'10 for querying the cube,

I've set up the querylog-properties in SSAS engine but it only captures the query from SSAS engine and not from the other platform such as Excel. So, when I use Usage based aggregation wizard, it shows the users/ueries from SSAS engine only. Is there any way to capture the user/query information that comes through Excel pivot table and somehow create aggregation through that information?


Any suggestion/help is very much appreciated,


excel pivot table linked to cube, unable to expand/collaps single field


I’m re-posting question. I’m using excel pivot table to browse a cube, for example the adventuresworks example. I drag dimension ‘Product Categories’ and ‘Sales Territory’ to Row Labels area, a date dimension to column, and any measure to Values area. Now I only want to expand ‘Europe’ under ‘Bikes’, but the excel  will expand ‘Europe’ under every ‘Product Categories’, is there any way to avoid that? In visual studio it works fine.

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

How to read Excel table?


If I  use Microsoft.Jet.OLEDB.4.0 to retreive for example named range or sheet from Excel and use it as data source for some server control on the ASP page, everything works fine. But when I try to get table from Excel like this: "select * from [Table1]", debugger complains that database engine could not find object Table1. So how should I reference Table1 in Excel file so that the database engine could find it?

Export Dataset to excel sheet in a required format?



I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

Table format of RadioButtonList


Hi All,

I have radiobuttonlist with 3 listItem, i need to give the table format to radiobuttonlist means it looks like table with row, how can i give, Any idea?

My code:-

<asp:RadioButtonList ID="RbAccount" runat="server" cssClass="Request">
<asp:ListItem Value="update" Selected="True">Change existing account </asp:ListItem>
<asp:ListItem Value="deprovision">Remove an account </asp:ListItem>
<asp:ListItem Value="new" Enabled="false">Create a new account </asp:ListItem>

If i am using this css style, it is giving me border all all the tables i have on page, i just want only this radiobuttonlist, Any idea ?

<style type="text/css">
    border:1px solid black;

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend