Creating A Table (like A Pivottable In Excel)...how?
Feb 14, 2006
I have a table in my DB with the following columns: PlayerID, RoundNum, Score.
PlayerID RoundNum Score
1 1 10
1 2 10
1 3 10
Any scoring for my game is going to end up in this table. However, I would like to display the score standings with a player's name at the far left, and with each Round as a column:
R1 R2 R3
Player1 10 10 10
Can any of the SQL gurus tell me if this is possible, and how it can be done? Thanks!
I am trying to create a pivot table in excel using Activex scripting but i am facing some problems in doing so, below is the code that I have written The line of the code where i am encountering error is highlighted in RED
Set ActiveWorkBook = oExcel.Workbooks.Open (sFile) Set oSheet = ActiveWorkBook.WorkSheets(1) oSheet.Range("A1:T1").Font.Bold = True oSheet.Cells.Select oSheet.Cells.EntireColumn.AutoFit oSheet.Range("A1").Select oSheet.Name = "Data_" & strName
Set oSheet = ActiveWorkBook.WorkSheets(2) oSheet.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= "Sheet1!A$:T$").CreatePivotTable TableDestination:=Range("A3"), TableName :="PivotTable2" oSheet.PivotTables("PivotTable2").SmallGrid = False With oSheet.PivotTables("PivotTable2").PivotFields("Supervisor") .Orientation = xlRowField .Position = 1 End With With oSheet.PivotTables("PivotTable2").PivotFields("Operator") .Orientation = xlRowField .Position = 2 End With With oSheet.PivotTables("PivotTable2").PivotFields("Tag") .Orientation = xlDataField .Position = 1 End With With oSheet.PivotTables("PivotTable2").PivotFields("Dept") .Orientation = xlPageField .Position = 1 End With With oSheet.PivotTables("PivotTable2").PivotFields("Branch") .Orientation = xlPageField .Position = 2 End With With oSheet.PivotTables("PivotTable2").PivotFields("Location") .Orientation = xlPageField .Position = 3 End With With oSheet.PivotTables("PivotTable2").PivotFields("Type") .Orientation = xlPageField .Position = 4 End With oSheet.PivotTables("PivotTable2").RefreshTable ActiveWorkBook.WorkSheets(3).Delete 'ActiveWorkBook.WorkSheets(2).Delete oExcel.ActiveWorkBook.Save
'With ActiveWorkBook ' .SaveAs sFile ' .save 'End With
I want to use the Office Web Components (v10) PivotTable embedded in a web page. The examples and tutorials I've been able to find on MSDN all use the same architecture: The initial pivottable configuration is created by instantiating the object server-side and programmatically configuring it. The XMLDATA property is then read and sent to the client. At the client, script sets the XMLDATA property. So far so good, all makes sense. Then my problem: The PivotTable is then connected to Analysis Server using an http connection string (through IIS). As my users do not have database accounts, only application accounts, I cannot allow database connection information on the client. Trouble is, the PivotTable generates MDX queries when a user reconfigures the view, and there are no hooks (events or other means) to programmatically obtain the generated MDX query - a fact that is explicitly confirmed in MSDN documentation.
This clearly means that the PT must be connected directly to it's data source. So I thought I could just create a local MOLAP cube file and download it to the client (permissible as it runs as a trusted application). But nowhere can I find any example or documention on how to do this.
This is driving me slightly insane and I have little hair left now; if anyone knows how to do it or where to find proper PivotTable documentation (rather than a collection of examples that do something else from what I need to do!) then help is greatly :p appreciated!
We have an SSAS Cube with the same data (in a dimensional schema).The report (currently sourced via SQL from our data warehouse):The Pivot Table - currently in Excel but needs to be ported to SSRS
I'm creating a report that is designed to be exported to Excel so that the end user can manipulate the data. There are two main columns that I'm concerned with - TimeTaken and OTTimeTaken (for overtime).
Our application does not track OTTimeTaken so it's default will just be 0, but I need the excel file to have a formula that automatically adds the TimeTaken to the OTTimeTaken in a third cell for the total number of hours as that value will be added by the A/R department for invoicing.
I have a created a DTS packges which is reading data from sql server table, manipulate this data as required and then create a text file with that data. I created the text file using FileSystemObject. I was writing one field at a time to the text file.
I need to same thing but instead of creating text file, I need to create a excel file with each column from database going to separate column in excel sheet. I tried to do this with FileSystemObject, but it was wrting all the columns from database to one cell in excel sheet. How can I fix this problem?
l've some excel files controlled by Vendor which changing frequently. The only thing does not change is the header name of each column.
So my question is, is there any way to create a new table based on the excel file selected including the column name in SSIS? So that l can use the data reader as source to select those columns l am interested on and start the integration.
Hi,Please help, I'm getting desperate. Any ideas warmly welcomed!I'm trying to read from a basic excel file (1000 or so rows fromcolumn A) but am having problems. The code I am using is:Declare @Return IntSET NOCOUNT ONExec @Return= [master]..[sp_addlinkedServer] 'READ_XLS', 'EXCEL','Microsoft.Jet.OleDB.4.0' , 'e:jsbackupRACodes.xls',NULL, 'EXCEL 8.0'print 'set up Return : ' + convert(varchar(10),@Return)--NB E: is the drive as seen oon the serverEXEC sp_addlinkedsrvlogin@rmtsrvname = 'READ_XLS',@useself = 'true'print 'login Return : ' + convert(varchar(10),@Return)When I try to read from the (one) excel sheet in the file, viaSelect * from [READ_XLS]...RACodes$or to list what tables/sheets are available, viaexec sp_tables_ex 'READ_XLS'I get the following error:OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.Authentication failed.[OLE/DB provider returned message: Cannot start your application. Theworkgroup information file is missing or opened exclusively by anotheruser.]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'IDBInitialize::Initialize returned 0x80040e4d: Authenticationfailed.].What am I missing?*Many* thanks in advance.Andy
Hi everybody, i'm a newbie to SSIS and I'm having a problem dynamically creating a new excel spreadsheet in SSIS. What I need to do is be able to dynamically create a brand new Excel spreadsheet after a data flow task completes.
When I try to create an Offline cube from Excel 2007 I get the following error message. This used to work but I cannot figure out what to loo for.
Code Snippet Microsoft OLE DB Provider for Analysis Services 2005 : OLE DB error: OLE DB or ODBC error: XML for Analysis parser: The 'CreatedTimestamp' read-only element at line 1, column 38747 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Cubes/Cube/Scripts/MdxScript was ignored.; XML for Analysis parser: The 'LastSchemaUpdate' read-only element at line 1, column 38803 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Cubes/Cube/Scripts/MdxScript was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 4554 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 17325 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 57387 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 60047 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 62847 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 65497 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 72718 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; XML for Analysis parser: The 'CurrentStorageMode' read-only element at line 1006, column 75425 (namespace http://schemas.microsoft.com/analysisservices/2003/engine) under Envelope/Body/Execute/Command/Batch/Create/ObjectDefinition/Database/Dimensions/Dimension was ignored.; Errors in the metadata manager. The attribute hierarchy for the Month attribute cannot be created because a hierarchy with the same ID or name already exists..
Can somebody advice my on what to look for? Thx!
The attribute hierarchy for the Month attribute cannot be created because a hierarchy with the same ID or name already exists. ----- There is no other Month?
I'm exploring creating local cube files, .cub from an excel sheet with tables.Would SSAS be able to create one cube from taking data from a 1 way table (A, B, C), a 2 way table (AxB, BxC, AxC) and a 3 way table (AxBxC)?
I have an exiting excel workbook say master.xls. Now I need to dynamically create and append a new worksheet to the above master.xls every month end using the Reporting services.
Could you please guide me how dynamically creating the worksheets task can be achieved using the reporting services?
Your any guidance or help in this matter will be highly appreciated.
Banti writes "IF i create temporary table by using #table and ##table then what is the difference. i found no difference. pls reply. first: create table ##temp ( name varchar(25), roll int ) insert into ##temp values('banti',1) select * from ##temp second: create table #temp ( name varchar(25), roll int ) insert into #temp values('banti',1) select * from #temp
both works fine , then what is the difference waiting for ur reply Banti"
Using SQL against a DB2 table the 'with' key word is used todynamically create a temporary table with an SQL statement that isretained for the duration of that SQL statement.What is the equivalent to the SQL 'with' using TSQL? If there is notone, what is the TSQL solution to creating a temporary table that isassociated with an SQL statement? Examples would be appreciated.Thank you!!
I am trying to create a table that holds info about a user; with the usual columns for firstName, lastName, etc.... no problem creating the table or it's columns, but how can I "restrict" the values of my State column in the 'users' table so that it only accepts values from the 'states' table?
Is it possible to creates fields of the table dynamically?. I have this situation in my project. This is just a small sample. I have row of length 140. I don't wan't to declare all this fields manually using the create table command.
The description of table is as, in this table all the field are of type varchar only, there are like 140 columns.
Table: Dummy ================================================== == field1 field2 field3.......... Empid Empname empaage1 sam 23........... 2 rai 22............ . . . n raj 45............. ================================================== == Now I want to create another table as "EMP" , with proper data type fields too..
Table: EMP ================================================== == Empid Empname empaage............ 1 sam 23............... 2 rai 22................ . . . n raj 45................. ================================================== ==
I want to do this dynamically..... Some how I need to extract those field from table[dummy]; the first row acts as a column header for the table[Emp] and the subsequent row acts as a record for the table[Emp]
A small rough snippet of the code will be appreciated....
I am using a Stored procedure in which I am creating a table and dropping that table at the end of execution. This SP is calling every 10 second (but no concurrent access) from my application. Is there any issue using the drop table command in the SP? will it create any memory fragmentation issue in SQL server?
I am attempting to create a stored procedure that will launch at report runtime to summarize data in a table into a table that will reflect period data using an array type field. I know how to execute one line but I am not sure how to run the script so that it not only summarizes the data below but also creates and drops the table.
I have a situation with a table that was created for a transactional
system with a 3 columns key. The table is similar to the following:
countrystatecitydescription 11221City A from country 1 and state 12 11321City A from country 1 and state 13 21422City B from country 2 and state 14 21522City B from country 2 and state 15
Now I'm trying to create a dts package that would allow me to build a
city dimension table with unique codes (keys) for each city. What kind of
transformation should I use to translate the old codes (based on the
country-state-city key) into the new ones and preserving the data
I'm trying to create programmatically a table in my db on sql server 2005.1. I created a string "CREATE TABLE ....." and then tried to execute it using my ADO. That didn't work, so I copied the string into a query in sql server and got the message "CREATE TABLE sql is not supported". Why's that? 2. I created a stored procedure in my db that will get the "CREATE TABLE...." string and execute it. I thought it would look something like this: parameter @createString varchar(MAX) BEGIN BEGIN EXEC @createString or @createString END END Both these options didn't work.How can I make it work properly?Thanks.
I need a module to help me create a SQLServer database table. Is there a module that allows users to specify parameters in the creation of a SQLserver table?
Does anyone know if it is possible to create a tmp table in RAM without pinning it and how to do it? I already knew that SQL has a stored procedure allows pinning a table in RAM. Thank you for any input.
How do you create a new table from a SELECT statement of another tableusing MS SQL Server. This is part of a distributed database topic foruniversity. Unfortunately I can only seem to get the new table createdin Oracle and not MS.