Database design to support parameterised interface with MS Excel

Hi, I am a novice user of SQL Server and would like some advice on how to solve a problem I have. (I hope I have chosen the correct forum to post this question)
I have created a SQL Server 2012 database that comprises approx 10 base tables, with a further 40+ views that either summarise the base table data in various ways, or build upon other views to create more complex data sets (upto 4 levels of view).
I then use EXCEL to create a dashboard that has multiple pivot table data connections to the various views.
The users can then use standard excel features - slicers etc to interrogate the various metrics.
The underlying database holds a single days worth of information, but I would like to extend this to cover multiple days worth of data, with the excel spreadsheet having a cell that defines the date for which information is to
be retrieved.(The underlying data tables would need to be extended to have a date field)
I can see how the excel connection string can be modified to filter the results such that a column value matches the date field,
but how can this date value be passed down through all the views to ensure that information from base tables is restricted for the specied date, rather than the final results set being passed back to excel - I would rather not have the server resolve the views
for the complete data set.
I considered parameterisation of views, but I dont believe views support parameters, I also considered stored procedures, but I dont believe that stored procedures allow result sets to be used as pseudo tables.
What other options do I have, or have I failed to grasp the way SQL server creates its execution plans and simply having the filter at the top level will ensure the result set is minimised at the lower level? (I dont really want the time taken for the dashboard
refresh to increase - it currently takes approx 45 seconds following SQL Server Engine Tuning Advisor recommendations)
As an example of 3 of the views, 
Table A has a row per system event (30,000+ per day), each event having an identity, a TYPE eg Arrival or Departure, with a time of event, and a planned time for the event (a specified identity will have a sequence of Arrival and Departure events)
View A compares seperate rows to determine how long between the Arrival and Departure events for an identity
View B compares seperate rows to determine how long between planned Arrival and Departure events for an identity
View C uses View A and view B to provide the variance between actual and planned
Excel dashboard has graphs showing information retrieved from Views A, B and C. The dashboard is only likely to need to query a single days worth of information.
Thanks for your time.

You are posting in the database design forum but it seems to me that you have 2 separate but highly dependent issues - neither of which is really database design related at this point.  Rather you have an user interface issue and an database programmability
issue.  Those I cannot really address since much of that discussion requires knowledge of your users, how they interface with the database, what they use the data for, etc.  In addition, it seems that Excel is the primary interface for your users
- so it may be that you should post your question to an excel forum.
However, I do have some comments.  First, views based on views is generally a bad approach.  Absent the intention of indexing (i.e., materializing) the views, the db engine does nothing different for a view than it does for any ad-hoc query. 
Unfortunately, the additional layering of logic can impede the effectiveness of the optimizer.  The more complex your views become and the deeper the layering, the greater the chance that you befuddle the optimizer. 
I would rather not have the server resolve the views for the complete data set
I don't understand the above statement but it scares me.  IMO, you DO want the server to do as much work as possible since it is closest to the data and has (or should have) the resources to access and manipulate the data and generate the desired
results.  You DON'T want to move all the raw data involved in a query over the network and into the client machine's storage (memory or disk) and then attempt to compute the desired values. 
I considered parameterisation of views, but I dont believe views support parameters, I also considered stored procedures, but I dont believe that stored procedures allow result sets to be used as pseudo tables.
Correct on the first point, though there is such a thing as a TVF which is similar in effect.  Before you go down that path, let's address the second statement.  I don't understand that last bit about "used as pseudo tables" but that sounds more
like an Excel issue (or maybe an assumption).  You can execute a stored procedure and use/access the resultset of this procedure in Excel, so I'm not certain what your concern is.  User simplicity perhaps? Maybe just a terminology issue?  Stored
procedures are something I would highly encourage for a number of reasons.  Since you refer to pivoting specifically, I'll point out that sql server natively supports that function (though perhaps not in the same way/degree Excel does).   It
is rather complex tsql - and this is one reason to advocate for stored procedures.  Separate the structure of the raw data from the user.
(I dont really want the time taken for the dashboard refresh to increase - it currently takes approx 45 seconds following SQL Server Engine Tuning Advisor recommendations)
DTA has its limitations.  What it doesn't do is evaluate the "model" - which is where you might have more significant issues.  Tuning your queries and indexing your tables will only go so far to compensate for a poorly designed schema (not that
yours is - just a generalization).  I did want to point out that your refresh process involves many factors - the time to generate a resultset in the server (including plan compilation, loading the data from disk, etc.), transmitting that data over the
network, receiving and storing the resultset in the client application, manipulating the resultset into the desired form/format), and then updating the display.  Given that, you need to know how much time is spent in each part of that process - no sense
wasting time optimizing the smallest time consumer. 
So now to your sample table - Table A.  First, I'll give you my opinion of a flawed approach.  Your table records separate facts about an entity as multiple rows.  Such an approach is generally a schema issue for a number of reasons. 
It requires that you outer join in some fashion to get all the information about one thing into a single row - that is why you have a view to compare rows and generate a time interval between arrival and departure.  I'll take this a step further and assume
that your schema/code likely has an assumption built into it - specifically that a "thing" will have no more than 2 rows and that there will only be one row with type "arrival" and one row with type "departure". Violate that assumption and things begin to
fall apart.  If you have control over this schema, then I suggest you consider changing it.  Store all the facts about a single entity in a single row.  Given the frequency that I see this pattern, I'll guess that you
cannot.  So let's move on.
30 thousand rows is tiny, so your current volume is negligible.  You still need to optimize your tables based on usage, so you need to address that first.  How is the data populated currently?  Is it done once as a batch?  Is it
done throughout the day - and in what fashion (inserts vs updates vs deletes)?  You only store one day of data - so how do you accomplish that specifically?  Do you purge all data overnight and re-populate?   What indexes
have you defined?  Do all tables have a clustered index or are some (most?) of them heaps?   OTOH, I'm going to guess that the database is at most a minimal issue now and that most of your concerns are better addressed at the user interface
and how it accesses your database.  Perhaps now is a good time to step back and reconsider your approach to providing information to the users.  Perhaps there is a better solution - but that requires an understanding of your users, the skillset of
everyone involved, what you have to work with, etc.  Maybe just some advanced excel training? I can't really say and it might be a better question for a different forum.   
One last comment - "identity" has a special meaning in sql server (and most database engines I'm guessing).  So when you refer to identity, do you refer to an identity column or the logical identity (i.e., natural key) for the "thing" that Table A is
attempting to model? 

Similar Messages

  • Java Application interface with MS Excel through DDE

    We have a financial application written in JAVA and have requests from users that want to interface with the application. Meaning, They would like the Java application interface with Excel. For example, if you had a C++ application, you could create a DDE link in Excel that points to the C++ application and receive the data.
    How could I do this with a Java Applictaion ? I was told that there was an application written that lets Java interface with Excel.
    Any ideas or does anyone know ?

    JNI

  • Need to design the database design to support Chinese language

    Hi,
      can anybody give me suggusstion to redesign the SQL Server 2008 R2 database with chinese language support for existing database with varchar datatype (Non- Unicode Data Type)
    Thanks
    Pari

    You have to use NVarchar. Here is the script. During Select also you need N in the string
    set nocount on
    go
    USE master;
    GO
    IF DB_ID (N'MyOptionsTest') IS NOT NULL
    DROP DATABASE MyOptionsTest;
    GO
    CREATE DATABASE MyOptionsTest
    COLLATE Chinese_Taiwan_Stroke_CI_AS;
    GO
    use MyOptionsTest
    go
    IF OBJECT_ID('jj1') IS NULL
    begin
    create table jj1 (name nvarchar(45))
    end
    go
    go
    insert into jj1
    select N'我家己人有淡薄無爽快。'
    insert into jj1
    select N's省城话; t省城話'
    insert into jj1
    select N'微软数据库'
    insert into jj1
    select N'你叫什么名字?'
    insert into jj1
    select N'歡迎!/ 不用謝!/ 不客氣!'
    insert into jj1
    select N'我想18號坐飛機到倫敦'
    select * from jj1
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Is a database table required for temporary interfaces with flat file data set source ?

    Folks,  this is the situation I have in ODI 11.1.1.7
    I have a temporary interface (yellow), called MJ_TEMP_INT,  that pulls data from TWO data sets in the source into a temporary target (TEMP_TARG). The catch is one data set pulls from a from a table whereas the other data set pulls from a flat file.  A union is done on the data sets.
    I then create another interface, called MJ_INT, that uses the MJ_TEMP_INT as a source and the target is a real db. table called "REAL_TARGET"
    Two questions:
    When I execute my second interface  (MJ_INT), I get a message "ORA-00942: table or view does not exist" because it is looking for a real db table TEMP_TARG. Why must I have one ? because I am pulling from a flat file ?
    On my second interface (MJ_INT) when I look at the property sheet of my source interface MJ_TEMP_INT (yellow), the checkbox next to "Use temporary interface as Derived table" is DISABLED.  Why ? Is is also because my temporary interface is pulling from a flat file ?
    I have attached a file that shows a screen shot of my ODI studio.
    By the way,  IF my temporary interface source has only one data set pulling from a db. table into a temporary target table, say called MJ_TEMP2_TARG,  and then when I use this temporary interface as a source to another other real db. target table (REAL2_TARGET),  THEN, every thing works.  ODI does not require me to have a real db. table MJ_TEMP2_TARG and the checkbox for "Use temporary interface as Derived table" is NOT DISABLED and my REAL2_TARGET table gets populated.
    Thank you in advance.
    M. Jamal.

    Thanks SH. I thought so. 
    Though I understand the reason to materialize the file in a staging area, but that almost defeats the purpose of having a temporary interface in this case if we have to save the data in a permanent db. table first.  I assume the db. table sticks around and is not automatically dropped once the interface executing ends.  If the db. table sticks around then I also must truncate it first before executing the temporary interface each time. Right ?

  • Suggestion:  Create a Database Design Forum

    I recommend the creation of a new forum dealing exclusively with database design questions, such as setting Primary Keys, Unique constraints, Check constraints, Indexes, schema-creation scripts, etc. There is no forum devoted exclusively to this topic now and I feel it would be very helpful to the user community. It would certainly make searching for answers to design questions much easier.

    Billy  Verreynne  wrote:
    Prohan wrote:
    I don't agree there.
    1. How to create a relational model certainly IS relevant to Oracle, which is a RELATIONAL DBMS.Oracle also supports data warehousing (star schema designs), network/hierarchical designs, object-relational designs - or pretty much any data model that you may come up with. Calling it just a relational DBMS is incorrect.
    2. Your point that logical models are independent of specific technology is correct. What you're missing is that if a specific technology makes use of a certain foundational body of knowledge, that knowledge is a legitimate topic for a forum whose users use that specific technology.That is putting the cart in front of the horse IMO.
    I would rather see data modeling and logical database design being done in a way that is untainted with specific vendor implementations and technology used. There needs to be a clear line dividing the design from the implementation. If not, then design decisions can (and will) be made based not on the correct logical data modeling principles, but whether it can be "handled" by the technology. A design that is tainted like that, will always be less than optimal (especially as technology is continually evolving and changing).
    An OTN forum for database design will invariable be tainted with Oracle technology - and instead of learning sound data modeling fundamentals, a warped view of data modeling will be conveyed. Where doing abc will be acceptable (when it is not), because Oracle has feature xyz that can make the flawed design work (in a fashion).Excellent points. I think (or at least hope) such a forum would attract some number of pure theorists to straighten out the view. This might make for a lively forum, and might actually influence the real products, and might even get the cart on the right side of the horse.
    Hmmm, I guess I do sound hopelessly optimistic.

  • Can a website built with adobe muse interface with a database such as an Excel spreadsheet?

    Is it possible for a website built in Adobe Muse to  interface with a database?  I need to turn a rather robust excel spreadsheet into an easy-to-use website that links to a database that can be updated easily and regularly.  Thanks.

    Hi,
    Muse is a designing software. You can design websites in Muse and host it on any server of your choice. There is no native feature in Muse to convert a spreadsheet into a website. If you are good with coding, you can develop it outside Muse and call it in Muse site using iframes, if at all it is helpful to you.
    Regards,
    Aish

  • Does anyone have a suggestion for an alternative to iCal that will interface with the Cloud? I find iCal to be poorly designed and not very efficient.

    Does anyone have a suggestion for an alternative to iCal that will interface with the Cloud so it works on the iPhone and the Macbook? I find iCal to be poorly designed and not very efficient. I waste a lot of time entering information because you can't go to a specific day and enter information, nor can you navigate between months and add information on a specific date by clicking on the date. You can't easily scroll month-to-month and once you do by scrolling through nine months to get to where you want to be, you cannot enter information by clicking on a specific day in the month and entering information. I just called Apple and they verified that this is the way it works. You cannot go to a date and enter information, you keep getting thrown back to today and then you have to go into the calendar and change it manually on the screen. It is just not efficient.

    APC, CyberPower are reliable.
    Look for 1500VA. As example:
    APC
    http://www.amazon.co.uk/APC-Back-UPS-Pro-1500-Connector/dp/B0041MP81Y/
    Cyperpower:
    http://www.amazon.co.uk/Dell-CyberPower-Intelligent-LCD-1500VA/dp/B005DL5L50/

  • What is the best design tablet with stylus to have an easy interface with Adobe Photoshop?

           What is best design tablet with stylus for use with Adobe Photoshop for this holiday seasons offering 2013?
    I am trying to find a tablet with good stylus  to work with Adobe Design products primarily Photoshop. I would like one that worked in layers with photoshop.
    The folks a Wacom don't even answer the phone just a recorded message go to the web site with questions.  Not a good sign for a company. So what is a good design tablets for pressure sensitive stylus? Will wacom cintiq tablet interface well with Apple Imac IOS 10.8?
    I love my Samsung note 3 but it will not easily transfer images to apple Imac 10.8.
    Please help me find tablets with good adobe design interface?  Just tell me which way to jump. It is easier to leave Apple for PC or Android  than to abandon Adobe knowledge. The products have to work together.
    Does wacom Cintiq not embrace an easy interface with Apple  Imac IOS 10.8 latest software. Wacom seems to be championing Windows 8 as a companion to their tablet interface.
    Can an Ipad deliver good layered designs using adobe software design programs and a stylus?
    What should I buy for an Adobe design tablet with pressure sensitive stylus for ths Holiday Season? 
    Should i wait until next year?
    Will the tablet work in  Photoshop layers?
    this link seemed ominus
    http://forums.adobe.com/message/4950467

    subhash007 wrote:It's not 802.3ad link aggreagated interface. In the switch side, the ports will be configured as normal access ports and the bonding config will be done on the server side.
    To be honest, I don't understand how the Linux bonding mode can work without anything configured the other end.
    My understanding of 'bonding' comes from Multilink PPP (MLP) where the data stream is chopped up and split across two (or more) circuits. At the other end, a similar MLP-enabled device reforms the data stream from the multiple circuits, maintaining packet order. But this requires MLP-enabled 'bonding' devices at each end.
    Perhaps you could help me better understand the Linux bonding...
    subhash007 wrote:If any single homed server is connected to Switch 2, what will be traffic path for its data packets?Switch 2 ------------------> Switch 1 ----------------------> Active firewall                                   ORSwitch 2 ------------------> Passive Firewall -----------> Active Firewall
    If the firewalls operate in the same fashion as Cisco ASAs, then the inter-firewall link doesn't carry traffic. It's for failover detection and HTTP replication only. But like I said, I'm not familiar with this vendor's products.
    subhash007 wrote:Also will there be any change in traffic path if the trunk between Switch 1 & Switch 2 is converted to L3 routed interface? Since there is no VRRP, i can convert the trunk to L3 right?
    Same as above.

  • Interfacing with AS/400 Database

    Has anyone used the database interconnectivity toolset to interface with an AS/400 Database? Are there any problems interfacing with this database using SQL?

    Although I've not used with AS/400 -- I have successfully used it with ease with Oracle, Ingres, Sybase, as well MS Access. The key is having the correct client drivers loaded. I've connected to DB's on both PC servers as well as mini/mainframes.
    Happy Wiring!

  • Is ADF meant for database designed with vertical schema ?

    Hi,
    I want to know if ADF 11g is meant for database designed with vertical schema where even the column names will be rows in a generic table?
    Thanks in advance.
    Edited by: user8925296 on Apr 12, 2010 10:06 AM

    The short answer is no...
    What you are calling a "vertical schema" is what others have called an entity-attribute-value or universal data model schema. I'd advise you to do some open-minded research about these types of schemas if you are developing a new application before you proceed. They sound great in practice, but have quite inherent usability and scalability issues. [url http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2314483800346542969]This might be a good place to start...
    John

  • How many connections supports a web interface with each camera and how many Adobe Encoder clients does AMS support? AMS Standart

    How many connections supports a web interface with each camera and how many Adobe Encoder clients does AMS support? AMS Standart. We need connect by  Adobe Encoder many people. what is differences between Adobe Media Server 5 Professional, Adobe Media Server 5 Standard and Adobe Media Server 5 Extended?

    For the detailed list of differences across editions refer this link
    http://www.adobe.com/in/products/adobe-media-server-family/buying-guide-comparison.html

  • Help with a database design for community housing project

    Talking database design
    Hi all, I have been wondering about the design of tables for a big block of residential units. There are 100 + rooms. there are about 25 houses in this complex but the 100 + rooms are all rented out separately.
    Its just like a college campus really but its not a college campus , its a little unique.
    The rents are applied as a percentage of income, so thats not common, so I included a tblRoomCost where the pre-calculated weekly cost is entered, and its got a date field in there for when the change of rent charged. I probably need to include an income field in tblCustomer, even just as an Admin reference.
    So is this looking pretty ok and would there be any point in scrapping the database and using text files ?
    So what do you think of these tables please ?
    tblCustomer
    pkCustomer, fldFirstName, fldLastname
    tblRoomAllocation
    pkRoomID, fkCustomer
    tblRoomCost
    pkRoomID, fldDate, fldRoomCost
    tblTransactionID
    pkTransactionID, fldDate, fldTransactionType, fkCustomer, fldAmount

    The naming scheme is one I learned and havn't thought past it though I do get into trouble and your suggestion may prove useful when codeing !
    I thought the tblRoomAllocation and tblRoomCost took care of changing. Though I see now that tbleRoomAllocation needs a Date field really. And the tblRoomCost has a fldRoomCost which isnt really that good an implementation as the rooms themselves are priced always accoedijng to the income of a resident and not because of the room. So the real world object is getting fudgy........
    It is extremely unlikly that Admin would ever allow two rooms to be rented by an individual.
    I will have a look at possibly your suggestion that an Accounts table be used.
    Also I thought about having a startDate and EndDate in the tblTransaction to represent the period being paid for. Just seems like a lot of Dates in a transaction table. One to record the transaction, the other two dates to indicate the period that was actually being paid for. ? When perhaps I should work that out in the runtime code.v ? This will be a VB.Net app.
    Do you think there is a need for Accounts table if only one room is permitted to be rented , though room changing may be common?
    And thx for your input.
    Message was edited by:
    user521381

  • Service Form interface with RACF DB2 Databases

    We are looking for a way to have service form interface with RACF using DB2 connect. This function is needed to perform data validation against mainframe system. Any advice or instructions of how to implement this is greatly appreciated.

    I am using Weblogic workshop test browser to test this code. My Ws code looks like this.
    package WebServ;
    public class AsyncWebServ1 implements com.bea.jws.WebService
    * @common:control
    * @jc:timer repeats-every="30 s" timeout="60 s"
    private com.bea.control.TimerControl MyTimerControl;
    * This member variable stores the client choice to be sent a callback or not.
    public boolean m_useCallback;
    * When the callback handler is fired, this boolean is set to true.
    * Clients that don't want callbacks check this boolean to see if their result is ready.
    public boolean m_messageIsReceived;
    public Callback callback;
    * @common:control
    private Control.xmlDocWSControl xmldocwscontrol;
    static final long serialVersionUID = 1L;
    private String xmlString = "";
    private String strName = "";
    * @common:operation
    * @jws:conversation phase="start"
    public void getWSEmplyeeInfoCON(String aName)
    MyTimerControl.start();
    xmlString = xmldocwscontrol.getEmplyeeDtlsCon(aName);
    return ;
    public interface Callback extends com.bea.control.ServiceControl
    * @jws:conversation phase="finish"
    public void testCallback(String result);
    * @common:operation
    public void MyTimerControl_onTimeout(long time)
    //xmlString = xmldocwscontrol.getEmplyeeDtlsCon(aName);
    if(!m_useCallback)
    m_messageIsReceived = true;
    else
    callback.testCallback(xmlString);
    MyTimerControl.stop();
    return;
    * @common:operation
    * @jws:conversation phase="continue"
    * @jws:protocol form-post="false" form-get="true"
    public boolean checkStatus()
    return m_messageIsReceived;
    * @common:operation
    * @jws:conversation phase="finish"
    * @jws:protocol form-get="true" form-post="false"
    public String getMessageResponse()
    return xmlString;
    * @common:operation
    * @jws:conversation phase="start"
    public void requestMessage(boolean useCallback)
    m_useCallback = useCallback;
    // Start the delay timer.
    MyTimerControl.start();
    return;
    The value of xmlString can be hard coded.
    Saju

  • Background Job Finishing with Database system not supporting

    Hi All,
    When i am running the RSCOLL00 program its executes all the programs and finally it says DataBase system not supporting.
    And i am not getting any dumps.
    Due to this in ST03N i could nt able to find the data for the present day and also last minutes load.
    Please guide me.
    Thanks,
    Mahesh

    Hi Kaushik,
    here is the log
    Job started
    Step 001 started (program RSCOLL00, variant , user ID HOUSEKEEPING)
    Clean_Plan:Cleanup of DB13 Plannings
    Clean_Plan:started by RSDBPREV on server tcs050983
    Clean_Plan:Cleaning up jobs of system PI7
    Clean_Plan:finished
    Database system not supported
    Job finished
    Thanks,
    Mahesh

  • New database design product - ModelRight for Oracle

    Whether you are a beginner or an expert data modeler, ModelRight for Oracle is the database design tool of choice for Oracle. Here are some of the things that make ModelRight for Oracle unique:
    •     Extensive support for Oracle – support and advanced features - OR types, object tables, object views, materialized views, index-organized tables, clusters, partitions, function-based indexes, etc...
    • full Forward, Reverse and Compare capabilities
    •     Unique User Interface and Diagrammatic elements: with our mode-less and hyperlinked user-interface, navigating and editing your model is intuitive and easy.
    •     Extensive use of Domains: you can create Domains for just about every type of object to propagate patterns, reusability & classification.
    •     Unprecedented level of programmatic control: you can control the smallest details of the FE and Alter Script generation process.
    Please check out our website at http://www.modelright.com and download the free trial version.
    Please let me know if you have any suggestions or comments.
    Thank you,
    Tim Guinther
    Founder, ModelRight, Inc.
    [email protected]
    (215) 534 5282

    Excellent product. Pretty impressive. Gorgeous diagrams and sophisticated reports. Loved the myriad of navigation ways and non-obtrusive modeless dialogs. Very easy to use!
    Keep the good work up.

Maybe you are looking for

  • WM - Storage Type Replenishment

    Hi everyone ! I have a little problem with the storage type replenishement in WM. I configured  two replenishment movements for 2 storage types : - First one for a storage type that manage the base unit of measure "pieces", and that has a "capacity c

  • DIfferent # of rows return using select * & select count(*)

    In debugging some code (OWB generated PL/SQL) I came across the situation where by a query with count(*) returns a value of 600 rows. The same where clause using select * reports only 300 rows selected. There are 600 rows to select. Any ideas why the

  • INST_RFC_GET_INTERFACE

    I am receiving the following message when installing the J2EE on WAS 6.20 Windows 2000 Server SP4 DB2 (47SR2) log: TRACE      [iaxxrfcimp.cpp:1083]            CAbRfcImpl::performFunctionCall Calling function module: INST_RFC_GET_INTERFACE INFO      

  • Traxkpoint press_to_select by default in LXDM

    I want to enable "press_to_select" for my trackpoint by default while booting and disable the touchpad at the some time. I use LXDM so I added echo -n 1 | tee /sys/devices/platform/i8042/serio1/serio2/press_to_select synclient TouchpadOff=1 & to /etc

  • Ajax load spry/xml dataset....

    I'm a noob. And a very frustrated one. I am using Ajax to load an external page into my main site. The external page has XML/Spry data attached to it. The page loads fine when executing the Ajax request, but the page will not display the XML data. An