473,703 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Store data horizontally or vertically?

My project is to automate testing of Stored Procedures
of type SELECT (at least for now).

I want to create a table where each stored procedure's
input parameter values are entered and in another table
the expected result value(s) are entered when executed
against a sample database containing manually entered
and verified data.

My current problem is that the stored procedures' input
parameters range from none to 50 parameters (ok now
that I think of it maybe this SP with 50 parameters is an
INSERT SP; regardless let's assume I have SPs that
require 10-20-30+ parameters).

My other problem is each stored procedures' returned
result could fall into any of these four categories:
- 1 row, 1 column
- 1 row, many columns
- many rows, 1 column
- many rows, many columns

So far I thought about 3 ways of storing the data:
1- 1 large table with 50 columns that can hold various
number of input parameter values. Similar type of table for
holding the output result for the four categories above.
2- 1 small table holding one value per row. All kinds of joins
with other tables to indicate which SP and which column the
value belongs to...
3- 1 individual table per stored procedure, this way the number
of columns in the table would match exactly the number of input
parameters.

Obviously the above 3 categories could apply both for the input
and output data.

Now I'm still in research mode and I haven't decided on any choice
yet. And I know each approach has serious consequences; let's just
say they are all with some limitations.

Has anyone dealt with this scenario before? This is the first time I
need a table to hold various types of returned data.

Just to give some numbers: possibly a few thousand SPs and very
likely each SP would have more than one test scenario.

What would you suggest?

Thank you
Nov 11 '05 #1
2 4253
On Thu, 10 Nov 2005 23:33:16 -0500, "serge" <se****@nospam. ehmail.com> wrote:
My project is to automate testing of Stored Procedures
of type SELECT (at least for now).

I want to create a table where each stored procedure's
input parameter values are entered and in another table
the expected result value(s) are entered when executed
against a sample database containing manually entered
and verified data.

My current problem is that the stored procedures' input
parameters range from none to 50 parameters (ok now
that I think of it maybe this SP with 50 parameters is an
INSERT SP; regardless let's assume I have SPs that
require 10-20-30+ parameters).

My other problem is each stored procedures' returned
result could fall into any of these four categories:
- 1 row, 1 column
- 1 row, many columns
- many rows, 1 column
- many rows, many columns

So far I thought about 3 ways of storing the data:
1- 1 large table with 50 columns that can hold various
number of input parameter values. Similar type of table for
holding the output result for the four categories above.
2- 1 small table holding one value per row. All kinds of joins
with other tables to indicate which SP and which column the
value belongs to...
3- 1 individual table per stored procedure, this way the number
of columns in the table would match exactly the number of input
parameters.

Obviously the above 3 categories could apply both for the input
and output data.

Now I'm still in research mode and I haven't decided on any choice
yet. And I know each approach has serious consequences; let's just
say they are all with some limitations.

Has anyone dealt with this scenario before? This is the first time I
need a table to hold various types of returned data.

Just to give some numbers: possibly a few thousand SPs and very
likely each SP would have more than one test scenario.

What would you suggest?

Thank you


Clearly, if you're going to use relational db tables to store the data, the
benefits of 1-m relationships outweigh the benefits of n-columns. That said,
when you're a hammer, every problem looks like a nail, and I'm not sure that
database tables are the best medium for storing your tests or results.

Check out fit.c2.com. Notice that there is a .NET implementation of FIT, that
should work very nicely as a platform to create FIT tests for MS SQL Server
stored procedures, though JDBC from Java would probably work fine, too.
Nov 11 '05 #2
serge (se****@nospam. ehmail.com) writes:
My other problem is each stored procedures' returned
result could fall into any of these four categories:
- 1 row, 1 column
- 1 row, many columns
- many rows, 1 column
- many rows, many columns

So far I thought about 3 ways of storing the data:
1- 1 large table with 50 columns that can hold various
number of input parameter values. Similar type of table for
holding the output result for the four categories above.
2- 1 small table holding one value per row. All kinds of joins
with other tables to indicate which SP and which column the
value belongs to...
3- 1 individual table per stored procedure, this way the number
of columns in the table would match exactly the number of input
parameters.

Obviously the above 3 categories could apply both for the input
and output data.

Just to give some numbers: possibly a few thousand SPs and very
likely each SP would have more than one test scenario.


At the one extreme, one does a full-fledged data model with a table
store_procedure s that defines the procedure as such. Then there is a
sub-table that defines the output columns, and then there is one that
holds with rows with output data. Note here that there would be one row for
each value. That is, if an SP returns 20 columns, one row in the result
set results in 20 rows in this table. It will be akweard to do this
transposing. For the input data you would have a similar arrangement,
although somewhat simpler, as parameters do not come in rows.

The other extreme is to say that each procedure is an object of its own,
and thus needs a table of its own. Here output rows can be stored as
rows. But with the number of tables you indicate, this will be quite
unmanagable. Then again, while the first extreme has fewer tables, there
is still the same amount of data to manage.

What I don't like is some sort of a middle ground as you indicate in
your first alternative. Somewhere you will need to store that colunm 25
for procedure A has the data type datetime. Then again, this is probably
the model that makes the test engine easiest to implement.

Steve indicated in his reply that a relational database may not be the
best data store for this situation. And maybe he is right. One solutinn
that has some appeal to me is to use XML. Each XML document would then be
the output from a stored procedure. Parameters could be handled in the same
way, but regular table storage may still work for them, as they have one
dimension less.

In SQL 2005 there is a native xml data type which simplifies this
implementation, but you coudl use ntext in SQL 2000 for the XML
docuemnts. You would have to get all data to client level for comparisons
though.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3912
by: mittal.pradeep | last post by:
What is the better table design for a data collection application. 1. Vertical model (pk, attributeName, AttributeValue) 2. Custom columns (pk, custom1, custom2, custom3...custom50) Since the data elements collected may change year over year, which model better takes of this column dynamicness
6
4721
by: Larry R Harrison Jr | last post by:
I have Access 97, and I have a report with a text box which has the "Can Grow" set to yes. Regardless, it still doesn't show all the data of the tet box. It does grow vertically, but the data still looks like this: Rather than Now is the time for all good men to come
1
558
by: Ravikanth[MVP] | last post by:
Hi Mike, One suggestion, include datagrid in div with scroll bars. Ravikanth >-----Original Message----- >I have loads of data to scroll through in my datagrid and therefore need
1
5289
by: Craig Banks | last post by:
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so the user doesn't have to scroll horizontally. Essentially, I want to wrap a datagrid row (not text in individual columns) with as much control as possible. Make sense? While this seems simple enough on the surface, I can't figure out how to do...
2
4706
by: sachjn | last post by:
Hi, I need to have a table along with other UI items in page which resizes horizontally and vertically with the browser window. That means table should accoupy the remaining available space in the browser window and should display horizontal and vertical scroll bars if content of table is more than available width & height. I can do similer to this by enclosing table in a <DIV> with style as : overflow:auto; height:200px etc. But things...
1
2204
by: AimeeRae | last post by:
I need to create a report based off the following table (column headings): Station/Date/TransType/Offer1/Offer2 Station can be either: (KTTB or WOA) Date is variable TransType can be either: (Inquiry, lead or new order) Offer 1 is a number Offer 2 is a number
1
3553
by: tanya2001 | last post by:
hi all now i have a query on crystal reports in .net.I have to generate a report in my webform by displaying one column vertically and other one horizontally....so how do u suggest...i should use it....i knw tht v do using d formula in crystal reports in .net but i have no idea of the formulae used in it....can somebody plzz help me generate this reports...thanx in advance..
2
3394
by: HowHow | last post by:
Using Access 2000, normally query returns result horizontally. Is there any way to set the query to return result vertically? For example, my query shown the result as below: Heading below 70 70-74 75-79 80-84 85 and above Value returned 128 54 137 190 294 Is there any way to show the result as below?
2
1881
by: ghjk | last post by:
I'm developing web based system using php and mysql. In there I want to drag and drop information horizontally and vertically. How can I do that? It is a table like below. ex: monday tuesday wednesday 9.00am Allocated Available Available 10.00am Available Requested Allocated 11.00am Available Available Available
0
8672
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6594
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5923
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4434
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.