Saturday, February 25, 2012

Designing Reports for SQL Reporting Services 2000

My customer has SQL Reporting Services on a server with SQL 2000 Standard Edition. The customer wants to develop his own Reporting Services reports. We have been recommending Visual Basic.NET Standard 2003 for this purpose in that it costs less than $100 (usually). However, with the advent of Visual Studio 2005, the VB.NET 2003 is becoming difficult or impossible to obtain. One option is Visual C#.NET Standard 2003 - I assume it will work - does anyone know for sure?

More importantly, when Visual C#.NET 2003 becomes unvailable, what options are left for developing RS 2000 reports?

Thanks for any suggestions.

Mark

>More importantly, when Visual C#.NET 2003 becomes unvailable, what options are left for developing RS 2000 reports?

None from Microsoft. There are third-party solutions, e.g. Cizer.

|||

You could also write a small tool that performs a RDL structure "downgrade" conversion (see e.g. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=988366&SiteID=1). However note that RS 2000 doesn't support a number of RS 2005 features (e.g. multi value parameters).

-- Robert

designing reports

Hi - we are just putting a proposal/costs together to implement reporting
services.
Might seem daft (!), I know i need the report designer and it works with the
visual studio .net 2003, but does that mean we need to buy visual studio .net
2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
both!
Thanks PaulThe designer comes free with SQL Server (you need a license for SQL Server
anywhere you have the server part of RS installed). But, the designer needs
some version (any version) of VS to install into. If you don't have VS 2003
then the cheapest thing to do is to buy VB.Net ($100).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> Hi - we are just putting a proposal/costs together to implement reporting
> services.
> Might seem daft (!), I know i need the report designer and it works with
the
> visual studio .net 2003, but does that mean we need to buy visual studio
.net
> 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> both!
> Thanks Paul|||Thanks for the info Bruce! We have SQL server but are hoping to migrate from
Actuate...
"Bruce L-C [MVP]" wrote:
> The designer comes free with SQL Server (you need a license for SQL Server
> anywhere you have the server part of RS installed). But, the designer needs
> some version (any version) of VS to install into. If you don't have VS 2003
> then the cheapest thing to do is to buy VB.Net ($100).
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > Hi - we are just putting a proposal/costs together to implement reporting
> > services.
> >
> > Might seem daft (!), I know i need the report designer and it works with
> the
> > visual studio .net 2003, but does that mean we need to buy visual studio
> ..net
> > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > both!
> >
> > Thanks Paul
>
>|||Hi Paul,
We too are evaluating products to migrate from Actuate. I can share our
findings if you're interested.
Bill
"Paul" wrote:
> Thanks for the info Bruce! We have SQL server but are hoping to migrate from
> Actuate...
> "Bruce L-C [MVP]" wrote:
> > The designer comes free with SQL Server (you need a license for SQL Server
> > anywhere you have the server part of RS installed). But, the designer needs
> > some version (any version) of VS to install into. If you don't have VS 2003
> > then the cheapest thing to do is to buy VB.Net ($100).
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > > Hi - we are just putting a proposal/costs together to implement reporting
> > > services.
> > >
> > > Might seem daft (!), I know i need the report designer and it works with
> > the
> > > visual studio .net 2003, but does that mean we need to buy visual studio
> > ..net
> > > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > > both!
> > >
> > > Thanks Paul
> >
> >
> >|||Hi Paul,
I have a lot of experience with Actuate (8 years) and am currently getting
up to speed on Reporting Services.
Let me know if you'd like to exchange information/experiences on migrating
from Actuate to Reporting Services.
-- Chris
--
Chris, SSSI
"Paul" wrote:
> Thanks for the info Bruce! We have SQL server but are hoping to migrate from
> Actuate...
> "Bruce L-C [MVP]" wrote:
> > The designer comes free with SQL Server (you need a license for SQL Server
> > anywhere you have the server part of RS installed). But, the designer needs
> > some version (any version) of VS to install into. If you don't have VS 2003
> > then the cheapest thing to do is to buy VB.Net ($100).
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > > Hi - we are just putting a proposal/costs together to implement reporting
> > > services.
> > >
> > > Might seem daft (!), I know i need the report designer and it works with
> > the
> > > visual studio .net 2003, but does that mean we need to buy visual studio
> > ..net
> > > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > > both!
> > >
> > > Thanks Paul
> >
> >
> >|||Hi Bill,
I have a lot of experience with Actuate (8 years) and am currently getting
up to speed on Reporting Services.
Let me know if you'd like to exchange information/experiences on migrating
from Actuate to Reporting Services.
-- Chris
Chris, SSSI
"Bill" wrote:
> Hi Paul,
> We too are evaluating products to migrate from Actuate. I can share our
> findings if you're interested.
> Bill
> "Paul" wrote:
> > Thanks for the info Bruce! We have SQL server but are hoping to migrate from
> > Actuate...
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > The designer comes free with SQL Server (you need a license for SQL Server
> > > anywhere you have the server part of RS installed). But, the designer needs
> > > some version (any version) of VS to install into. If you don't have VS 2003
> > > then the cheapest thing to do is to buy VB.Net ($100).
> > >
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > > news:ED6BE78D-8085-4A3A-8F01-6BD0408734D9@.microsoft.com...
> > > > Hi - we are just putting a proposal/costs together to implement reporting
> > > > services.
> > > >
> > > > Might seem daft (!), I know i need the report designer and it works with
> > > the
> > > > visual studio .net 2003, but does that mean we need to buy visual studio
> > > ..net
> > > > 2003 (std/dev/enterprise?) and the designer comes free? Or vice versa? Or
> > > > both!
> > > >
> > > > Thanks Paul
> > >
> > >
> > >

Designing Report in VS.NET2003 - studio is crashing

I am using reporting services 2000 already for 2 years. This problem is occurring on 2-3 reports, I can't say exactly what is the reason.

How I use the report designer is pretty simple and consistent. Report data is usualy produced by calling a stored procedure (on SLQ server 2000), I have a few parameters. Some of Paramaters are dates with a default values calculated to give yesterday's date or today - 7 days. And that is the only code in the report itselft. As soon as I click on Yes/No paramater, that doesn't have default, and is int in proc and report, then complete Visual Studio Environment starts flashing, making bip-bip noise, and is blocked, no access and reponse. I can't close it for a while, I can't bring up task manager, and in general this crash is very much resource intensive, Outlook is freezing, can't open IE, new spreadsheet. I am working on windows Xp platform. Eventually I would manage to close VS thru task manager.

As soon as this report is uploaded to Report Manager, the place where all the reports are available to users, on different server, the same report works fine.

Has anyone experienced this and what would be the reason.

Thanks in advance,
Elizabeta R

did you get out of memory exception.. check ur database may be it contains huge data..

run the query in sql server..

Designing relational tables

Hi, not sure if this is the right forum for this question.

I am creating relational tables for the first time in sql server express. I will have an orderItems table and an orders table. the MenuItems table is the problem. It is a catalogue of books. There will be about ten columns. all are unique to each book. i.e isbn number, title, author, publisher etc. but ten columns seems to be quite cumbersome. it may be easier to break the table down into two tables (i.e. primary details and secondary details perhaps) However to populate the table in the first place it would be easier to have it as one table instead of opening and closing 2 tables Adding the odd book to the two tables in the future would not be a problem. so the question is can i create a table and then brak it into two relational tables afterwards. If so how do i do this. this is my foirst go at relational tables and i am still trying to get a handle on visualising them. If my logic is up the wall please let me know...

Nick

Yes you can do this. Once you have your "big" table populated simply create the second smaller table and just execute an update statement:

update mySmallTable
set field1 = b.field1
, field2 = b.field2
, field3 = b.field3
from myBigTable b

|||

Great. Im really moving forward now. thanks for your time

Nick

Designing Primary Key and Clustered Index and Performance

I have several tables where the clustered index (the
physical way the data is stored) is different from the
Primary Key (which is just a unique number). It seems to
me that this will help me the most, as the clustered
index supports my SELECT statements, and the Primary Key
column will support my UPDATE and DELETE statements. I
am very new to SQL Server. My question is this. Is
designing the tables this way ok to do, or is this not
how it should be done?
Second part of my question is, If what I am doing is
fine, then does it make a difference (performance wise)
if I have the Primary Key column the first column table
or about the seventh column in?
Thanks so much for your help.Depends on who you ask. Zealots will say that you should never, ever use an
arbitrary unique integer as a row identifier. I disagree. However,
whenever possible, even if you are using a unique identifier you should
attempt to set a 'natural' primary key based on uniqueness in your data, and
use this for your primary key rather than the row identifier. You can still
use the ID to make life simpler (e.g. passing back lists of rows to client
applications for singleton selection), but the primary key will help
maintain and validate the table's data.
As for location within the column list, it makes no difference where
anything is. Don't rely on the ordering of your column list. Always
specify explicit column lists in the order you want them for selects and
inserts.
"Nancy" <anonymous@.discussions.microsoft.com> wrote in message
news:052b01c3aee5$09ea4e00$a301280a@.phx.gbl...
> I have several tables where the clustered index (the
> physical way the data is stored) is different from the
> Primary Key (which is just a unique number). It seems to
> me that this will help me the most, as the clustered
> index supports my SELECT statements, and the Primary Key
> column will support my UPDATE and DELETE statements. I
> am very new to SQL Server. My question is this. Is
> designing the tables this way ok to do, or is this not
> how it should be done?
> Second part of my question is, If what I am doing is
> fine, then does it make a difference (performance wise)
> if I have the Primary Key column the first column table
> or about the seventh column in?
> Thanks so much for your help.|||Placing the clustered index on a column other than the primary key is often
wise.
You only get ONE clustered index per table so use it wisely (Which is what I
believe you are doing).
If you are new to SQL Server, welcome to the community.
I recommend starting with these 3 books:
1. Inside SQL Server 2000 by Kalen Delaney
2. Professional SQL Server 2000 Programming By Robert Vieira
3. Transact-SQL Programming by Kline
Cheers
Greg Jackson
Portland, OR

Designing inventory system

Hi

Good Day!

I am designing a database to manage an Inventory system. I have two tables in it - Receives and Issues with two common fields -ProductID and Quantity.

I need some facilities in the database -

# Current Stock - Two fields - ProductID & BalanceQty. I want to get the balance quantity for a given product.

# Product Ledger - I want to have a ledger of product transaction with Date, ReceiveQty, IssueQty, Balance.

How can I have these facilities? Should I use a SProc or View? I need some expert openion. Please give me some details example. I am very new in SQLServer.

Thnk you very much!

Regards

Kapalic

Your question isn't really very clear to me, but it is really down to what you are using the data for. I would say stored procedure if this is used in a user interface (particularly in a single location), or a view if you want to be able to access the data in multiple locations, or perhaps for ad-hoc access...

I am in favor of using stored procedures for all access to the database in your user interfaces to make things easier to maintain and use.|||

I agree with Louis. A stored procedure will be easier to maintain and easier to secure.

You definitely want the [CurrentStock].[BalanceQty] values to be dynamically calculated -and not static data stored in a table.

|||

You can use a stroed procedure where you can pass the ProductId & you can get the BalanceQty & other details - it should be handy

|||

Thnx guys for ur answers. Actually I couldn't make myself clear.

Can anyone please give me an example how to write these sprocs? I need to check if enough product exist in the receive table before issueing a product in the issue table.

Thnx!

|||

If you mean protecting against over promising stock, if the tables are in the same database, I would use two techniques:

1. Stored procedure to calculate available stock when the user asks for the list (like when a user of Amazon goes to the page of a product and it says they have 3 in stock

2. A trigger that prevents an order from being placed without stock being available.

The second one will be a bit, because you will likely want to let the user backorder a product, but your order item for a product should be clearly marked as that, so the user doesn't get stuck waiting forever. So the calculation of available stock must take into consideration:

1. Will this product be stocked again (status of the product)

2. It there stock to cover the order now, even if there was when the user chose to order it, if not reject the line item, unless the user has specifically said "okay to back order"

But I would use a trigger to make sure that the status of the line item matched the expectation of order.

|||

Thnx Buddys!

I've written a view to show all the product with current stocks (PurchaseQty - IssueQty - DamageQty). And a sproc to wrap the view.

But I can't get an way to show a ledger for individual products, like -

Date Product PurchaseQty IssueQty DamageQty BalanceQty

Regards

Kapalic

|||

Use a WHERE clause, passing in the ProductID -both in the stored procedure and the VIEW.

Very similar to the code we wrote for you last week.

Designing inventory system

Hi

Good Day!

I am designing a database to manage an Inventory system. I have two tables in it - Receives and Issues with two common fields -ProductID and Quantity.

I need some facilities in the database -

# Current Stock - Two fields - ProductID & BalanceQty. I want to get the balance quantity for a given product.

# Product Ledger - I want to have a ledger of product transaction with Date, ReceiveQty, IssueQty, Balance.

How can I have these facilities? Should I use a SProc or View? I need some expert openion. Please give me some details example. I am very new in SQLServer.

Thnk you very much!

Regards

Kapalic

Your question isn't really very clear to me, but it is really down to what you are using the data for. I would say stored procedure if this is used in a user interface (particularly in a single location), or a view if you want to be able to access the data in multiple locations, or perhaps for ad-hoc access...

I am in favor of using stored procedures for all access to the database in your user interfaces to make things easier to maintain and use.|||

I agree with Louis. A stored procedure will be easier to maintain and easier to secure.

You definitely want the [CurrentStock].[BalanceQty] values to be dynamically calculated -and not static data stored in a table.

|||

You can use a stroed procedure where you can pass the ProductId & you can get the BalanceQty & other details - it should be handy

|||

Thnx guys for ur answers. Actually I couldn't make myself clear.

Can anyone please give me an example how to write these sprocs? I need to check if enough product exist in the receive table before issueing a product in the issue table.

Thnx!

|||

If you mean protecting against over promising stock, if the tables are in the same database, I would use two techniques:

1. Stored procedure to calculate available stock when the user asks for the list (like when a user of Amazon goes to the page of a product and it says they have 3 in stock

2. A trigger that prevents an order from being placed without stock being available.

The second one will be a bit, because you will likely want to let the user backorder a product, but your order item for a product should be clearly marked as that, so the user doesn't get stuck waiting forever. So the calculation of available stock must take into consideration:

1. Will this product be stocked again (status of the product)

2. It there stock to cover the order now, even if there was when the user chose to order it, if not reject the line item, unless the user has specifically said "okay to back order"

But I would use a trigger to make sure that the status of the line item matched the expectation of order.

|||

Thnx Buddys!

I've written a view to show all the product with current stocks (PurchaseQty - IssueQty - DamageQty). And a sproc to wrap the view.

But I can't get an way to show a ledger for individual products, like -

Date Product PurchaseQty IssueQty DamageQty BalanceQty

Regards

Kapalic

|||

Use a WHERE clause, passing in the ProductID -both in the stored procedure and the VIEW.

Very similar to the code we wrote for you last week.

designing inheriting entities

Dear All,
our customer has 3 kinds of entites
the first one is the ApplicationCenter where students can register to
exams...
and there are types of app centers like University offices, high schools
etc.. these types goes to another table..
and finally each type has its own instances like University one ,
university2 , univ3 etc. which means there are several more tables Like
universities , highschools , examCenters etc...
the requirement is to have ADD/Edit/Delete screens of all ApplicationCenters
of the customer..
the listing of the centers and their info is straightforward however when it
is time to edit many entities needs to be updated at the same time
.........
i am trying to figure out a table design where i can build sort of
inheriting entities..
any clue?
best regards..
emre dincer
Emre DNER wrote:
> Dear All,
> our customer has 3 kinds of entites
> the first one is the ApplicationCenter where students can register to
> exams...
> and there are types of app centers like University offices, high schools
> etc.. these types goes to another table..
> and finally each type has its own instances like University one ,
> university2 , univ3 etc. which means there are several more tables Like
> universities , highschools , examCenters etc...
> the requirement is to have ADD/Edit/Delete screens of all ApplicationCenters
> of the customer..
> the listing of the centers and their info is straightforward however when it
> is time to edit many entities needs to be updated at the same time
> ........
> i am trying to figure out a table design where i can build sort of
> inheriting entities..
> any clue?
> best regards..
> emre dincer
It is possible to ensure that each common attribute appears only in
one place in the hierarchy for each type of entity. Therefore the
problem of updating the same attribute in multiple places won't arise.
Fifth Normal Form and the Principle of Orthogonal Design are two
principles that will help you achieve a good model. Google for them if
you aren't already familiar with them.
David Portas

designing inheriting entities

Dear All,
our customer has 3 kinds of entites
the first one is the ApplicationCenter where students can register to
exams...
and there are types of app centers like university offices, high schools
etc.. these types goes to another table..
and finally each type has its own instances like university one ,
university2 , univ3 etc. which means there are several more tables Like
universities , highschools , examCenters etc...
the requirement is to have ADD/Edit/Delete screens of all ApplicationCenters
of the customer..
the listing of the centers and their info is straightforward however when it
is time to edit many entities needs to be updated at the same time
........
i am trying to figure out a table design where i can build sort of
inheriting entities..
any clue?
best regards..
emre dincerEmre D=DDN=C7ER wrote:
> Dear All,
> our customer has 3 kinds of entites
> the first one is the ApplicationCenter where students can register to
> exams...
> and there are types of app centers like university offices, high schools
> etc.. these types goes to another table..
> and finally each type has its own instances like university one ,
> university2 , univ3 etc. which means there are several more tables Like
> universities , highschools , examCenters etc...
> the requirement is to have ADD/Edit/Delete screens of all ApplicationCente=[/vbcol
]
rs[vbcol=seagreen]
> of the customer..
> the listing of the centers and their info is straightforward however when =[/vbcol
]
it[vbcol=seagreen]
> is time to edit many entities needs to be updated at the same time
> ........
> i am trying to figure out a table design where i can build sort of
> inheriting entities..
> any clue?
> best regards..
> emre dincer
It is possible to ensure that each common attribute appears only in
one place in the hierarchy for each type of entity. Therefore the
problem of updating the same attribute in multiple places won't arise.
Fifth Normal Form and the Principle of Orthogonal Design are two
principles that will help you achieve a good model. Google for them if
you aren't already familiar with them.
David Portas

designing inheriting entities

Dear All,
our customer has 3 kinds of entites
the first one is the ApplicationCenter where students can register to
exams...
and there are types of app centers like University offices, high schools
etc.. these types goes to another table..
and finally each type has its own instances like University one ,
university2 , univ3 etc. which means there are several more tables Like
universities , highschools , examCenters etc...
the requirement is to have ADD/Edit/Delete screens of all ApplicationCenters
of the customer..
the listing of the centers and their info is straightforward however when it
is time to edit many entities needs to be updated at the same time
........
i am trying to figure out a table design where i can build sort of
inheriting entities..
any clue?
best regards..
emre dincerEmre D=DDN=C7ER wrote:
> Dear All,
> our customer has 3 kinds of entites
> the first one is the ApplicationCenter where students can register to
> exams...
> and there are types of app centers like University offices, high schools
> etc.. these types goes to another table..
> and finally each type has its own instances like University one ,
> university2 , univ3 etc. which means there are several more tables Like
> universities , highschools , examCenters etc...
> the requirement is to have ADD/Edit/Delete screens of all ApplicationCente=rs
> of the customer..
> the listing of the centers and their info is straightforward however when =it
> is time to edit many entities needs to be updated at the same time
> ........
> i am trying to figure out a table design where i can build sort of
> inheriting entities..
> any clue?
> best regards..
> emre dincer
It is possible to ensure that each common attribute appears only in
one place in the hierarchy for each type of entity. Therefore the
problem of updating the same attribute in multiple places won't arise.
Fifth Normal Form and the Principle of Orthogonal Design are two
principles that will help you achieve a good model. Google for them if
you aren't already familiar with them.
--
David Portas

designing history tables

Could some one please point me to a good resource on how to design history
tables in a dataware house situation'
For example, in the case of products table, if product description got
changed over time after the product was purchased. The old invoice still
shows the old description but the table reflects the new one.
How could some one keep track of both descriptions?
What would be a good design/architecture'
TIA...Well, the invoices table should contain a relatively permanent piece of
data, such as a ProductID of some kind, not a much more flexible piece of
information like a description.
That said, it may still be useful to store the history of a product.
Probably the simplest in this very specific case would be:
CREATE TABLE dbo.ProductDescriptionHistory
(
ProductID INT NOT NULL
FOREIGN KEY REFERENCES dbo.Products(ProductID),
Description VARCHAR(255),
EffectiveDate SMALLDATETIME
)
This will allow you to reconstruct invoices from the past, with the correct
"at the time" description, without bloating the invoices table with a big
VARCHAR that will usually be redundant.
You will probably come across the same dilemma with price... do you store
price data for products where the price may or may not change, or do you
just reference the productID?
Your exact solution will at least partially depend on some of the
information you haven't provided, such as exactly why you need the historic
descriptions, what you're going to do with them, and how often they actually
change.
"sqlster" <nospam@.nospam.com> wrote in message
news:3F41C612-B1AB-441F-AED7-26F4C7ABEA09@.microsoft.com...
> Could some one please point me to a good resource on how to design history
> tables in a dataware house situation'
> For example, in the case of products table, if product description got
> changed over time after the product was purchased. The old invoice still
> shows the old description but the table reflects the new one.
> How could some one keep track of both descriptions?
> What would be a good design/architecture'
> TIA...|||<Aaron>
Your exact solution will at least partially depend on some of the
information you haven't provided, such as exactly why you need the historic
descriptions, what you're going to do with them, and how often they actually
change.
</Aaron>
I need the historic descriptions for the reporting purposes only. Some of
the values could change 10 - 15 times a month.
Thanks
"Aaron Bertrand [SQL Server MVP]" wrote:

> Well, the invoices table should contain a relatively permanent piece of
> data, such as a ProductID of some kind, not a much more flexible piece of
> information like a description.
> That said, it may still be useful to store the history of a product.
> Probably the simplest in this very specific case would be:
> CREATE TABLE dbo.ProductDescriptionHistory
> (
> ProductID INT NOT NULL
> FOREIGN KEY REFERENCES dbo.Products(ProductID),
> Description VARCHAR(255),
> EffectiveDate SMALLDATETIME
> )
> This will allow you to reconstruct invoices from the past, with the correc
t
> "at the time" description, without bloating the invoices table with a big
> VARCHAR that will usually be redundant.
> You will probably come across the same dilemma with price... do you store
> price data for products where the price may or may not change, or do you
> just reference the productID?
> Your exact solution will at least partially depend on some of the
> information you haven't provided, such as exactly why you need the histori
c
> descriptions, what you're going to do with them, and how often they actual
ly
> change.
>
> "sqlster" <nospam@.nospam.com> wrote in message
> news:3F41C612-B1AB-441F-AED7-26F4C7ABEA09@.microsoft.com...
>
>|||Keep who changed the rows and when in separate columns in the archive table.
You might also want to keep a record of whether the row in the main table wa
s
updated or deleted.
E.g.:
Main table:
Col1 : Col2 : ... : ColN
Archive table:
Col1 : Col2 : ... : ColN : ChangedDateTime : ChangedBy : ChangeType
Of course changes are propagated to the archive table via triggers on the
main table (for update and for delete).
For a more elaborate solution, please at least provide DDL.
ML
http://milambda.blogspot.com/|||ML,
I am just looking for some books/websites/articles that address good history
table design. The example that I brought up is just a hypothetical example s
o
I don't have any DDL.
TIA..
"ML" wrote:

> Keep who changed the rows and when in separate columns in the archive tabl
e.
> You might also want to keep a record of whether the row in the main table
was
> updated or deleted.
> E.g.:
> Main table:
> Col1 : Col2 : ... : ColN
> Archive table:
> Col1 : Col2 : ... : ColN : ChangedDateTime : ChangedBy : ChangeType
> Of course changes are propagated to the archive table via triggers on the
> main table (for update and for delete).
> For a more elaborate solution, please at least provide DDL.
>
> ML
> --
> http://milambda.blogspot.com/

Designing groups in multiple columns

hello,
> i am designing a grade report and i got a problem, the problem is that me divided the report into two columns, me grouped the records on the basis of semesters. now i want to show the first semester's records in first column and second semester's records in second column, then third semester's records in first column and so on.. but it doesn't hapens so. i want to set the layout of the group but there is not any option to set layout of the group.there is layout option for section but not for group. what me should do ? ? ?
iam desiginging one report for one student. each student have multiple semester and each semester consist of multiple subjects.I hace CR XI, go to details, section expert, layout with multiple columns, you should see a layout tab pop up in the upper right, click on it, you can control the direction the data flows as well as turn on, layout groups with multiple columns.

designing for encryption ...

In light of SARBOX, ChoicePoint security breaches, identity theft etc, what
are some best practices regarding encryption and security of this type of
info? I know this is a pretty broad question, so links to other sites are
great, but I'd like to hear some personal experiences and opinions.
The reason is I have identified what I consider potential security problems
in our systems. I need to get get a sense of how critical these particular
issues are (I tend to take the position that hyper vigilence is best so for
me everything is critical) and get them in front of management to hopefully
get some action. But I always think it's best to have at least a proposal
for a solution when presenting a problem.
Anyway, any feedback is most appreciated.
Bob Castleman
DBA PoseurHere is a little something from a mind far greater than mine...
http://vyaskn.tripod.com/sql_server...t_practices.htm
Peter
"The length of this document defends it well against the risk of its being
read."
Winston Churchill
"Bob Castleman" wrote:

> In light of SARBOX, ChoicePoint security breaches, identity theft etc, wha
t
> are some best practices regarding encryption and security of this type of
> info? I know this is a pretty broad question, so links to other sites are
> great, but I'd like to hear some personal experiences and opinions.
> The reason is I have identified what I consider potential security problem
s
> in our systems. I need to get get a sense of how critical these particular
> issues are (I tend to take the position that hyper vigilence is best so fo
r
> me everything is critical) and get them in front of management to hopefull
y
> get some action. But I always think it's best to have at least a proposal
> for a solution when presenting a problem.
> Anyway, any feedback is most appreciated.
> Bob Castleman
> DBA Poseur
>
>|||SARBOX is not an area I'm expert in but one thing I know about security
is that it isn't the same as encryption. Encryption is just one tool
for security. So "designing for security" is something different from
"designing for encryption" and I would advise you to focus on the
former rather than the latter. As I understand it SARBOX does NOT
mandate that any data be encrypted it just requires "adequate" internal
controls.
David Portas
SQL Server MVP
--|||I believe that Sarbanes Oxley suggests or recommends all "Sensitive" data be
encrypted in a data store.
SSNs
Account Numbers
Visa Numbers
etc etc etc
I could be wrong (I'm not a SOX Audit expert either)
Greg Jackson
PDX, Oregon|||Not a lawyer or security expert but California law, SB 1386
(http://info.sen.ca.gov/pub/01-02/bi...86_bill_2002092
6_chaptered.html) mentions unencrypted data. It seems that if someone where
to breach your database and personal information was encrypted you would not
need to disclose the breach.
See [url]http://informationw.com/story/showArticle.jhtml?articleID=10700814[/url]
for an overview...
"pdxJaxon" <GregoryAJackson@.Hotmail.com> wrote in message
news:%23Jf3G$8LFHA.576@.TK2MSFTNGP15.phx.gbl...
> I believe that Sarbanes Oxley suggests or recommends all "Sensitive" data
be
> encrypted in a data store.
> SSNs
> Account Numbers
> Visa Numbers
> etc etc etc
> I could be wrong (I'm not a SOX Audit expert either)
> Greg Jackson
> PDX, Oregon
>

designing for both pdf and excel rendering

A report I designed looked perfect html and pdf but when exported to excel it chops off the last column when printed. Does the report grow when exported to excel? How can I fix this? If I change the margins it fixes on the excel side but then the page doesn't look right on the pdf side. Thank you in advance for any help.Microsoft any suggestions please.

Designing dimensions and partitions on heavy loaded dimensions

I need your help designing a complex AS solution.

Here's the story -
My application is a hosted BI solution meant to serve several customers on a single machine.
Most of the data of my customers is not sharable / has no reason to share (For instance - customer1 products has not intersection with customer2 products)
There are few and small dimensions that are common to everyone - for instance: geographic and time dimensions.

I was thinking of two options to approach such a problem, I’d like to hear you opinion on them:
1. One DB for several (~10) customers (meaning VERY big dimensions > 15M).
Using lot of where [Customers].[CustomerX] and non empty in any of the queries to programmatically separate data.
Setting partitions slicing per customer and month.
One connection string.
2. Separate DB for each customer (meaning complex maintenance)
Products (for example) dimension is always specific to a single customer.
Setting different connection strings for each customer and physically separate all dimensions on different files.

More details to take into consideration:
The application consists of 10 dimensions, 3 of them are VERY big: ~3M per customer.
As for partitions - few 10s of millions of facts per customer per month.

It's difficult to say what is best, this is not really a typical application.

I would tend to lean away from option 1. Using a single connection string and trying to filter manually would be prone to errors and if users were able to execute any sort of adhoc queries they might be able to circumvent your "security". I would use multiple connections and setup some sort of role bases security instead and this would imply using multiple connections.

If all/most of the dimensions were shared, I would say put the data in one cube (with plenty of partitions) and use security roles to restrict access. If nothing significant can be shared, in my opinion, I would think that multiple databases would be better, but this is not a situation I have had to deal with myself.

I have the following issues with a single database solution:

What happens if you need to scale out to multiple SSAS servers? With Multiple DBs it would be relatively easy to shift some of them to another server.

What about backup/restore - SSAS 2005 has issues where backs take exponentially longer as the database gets larger.

What happens when corrupt/incorrect data gets loaded for one customer and you need to re-process? Do you want to take down all customer access or just that to the affected customer?

If the bulk of the data is not shared, you are not saving much memory by consolidating multiple customers into one database.

Formulas might need to be calculated across the entire cube subspace regardless of the customer, before a "non-empty" can be performed significantly reducing performance.

If you have products from multiple customers in one cube you could get clashes where different customers have different products with the same name.

Designing Date and Time Dimension

I need to display reports based on an SSAS cube which requires both date and time as input parameters.

I'd like to know what is the best practice while designing dimensions in such a scenario. Do i need to design a separate dimension for date ( quarter, year, month, week, day) and time ( hour, minute, second) ?

Or will having just the date dimension with the date key pointing to the full datetime in the fact table suffice?

I guess there is no correct answer to this question, but in my opinion you should design two dimensions - one for the dates and one for the seconds (with related attributes, of course). If you put it all in one dimension, your time dimension would consist of 60 x 60 x 24 x 365 = 31,536,000 members for each year (!!!), whereas if you make two separate dimensions, you have a date dimension with 365 members for each year and a time dimension with 86,400 members (constant). This will be much more performant and simple to work with in most cases.

Designing Database Diagramm

Hi,
i am looking for a tool to design den model of a database.
i took a look at powerdesigner, embacadero..
which one do you prefer to design the model.
i am using SQL SERVER 2005.
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200602/1HI,
There are quite a few out there,
Erwin,
Visio,
Case Studio
Datanamics Dezign
All depends on the indivisual, the project, what you like, what you want to
do.
I use both case studio and dezign, because it fits my needs and I can afford
it.
Robert
"fantasimus via webservertalk.com" <u16093@.uwe> wrote in message
news:5bf54d8709c30@.uwe...
> Hi,
> i am looking for a tool to design den model of a database.
> i took a look at powerdesigner, embacadero..
> which one do you prefer to design the model.
> i am using SQL SERVER 2005.
> --
> Message posted via webservertalk.com
> http://www.webservertalk.com/Uwe/Forum...amming/200602/1

designing data entry form with scope_identity .....help

hi i'm thinking of putting 3 texboxes for the user to enter their previous work exp which look something like this:

experience
First job.textbox
Secondjob.textbox
Thirdjob.textbox

i'm kinda confuse on with the database. The 3 tables required means i will hav 3 sqldatasource ...
which i didin't quite get it right with the Secondjob table.I try using identity_scope() and @.@.identity to get the ID from my first table(personel)
which is autogenerate number. It works fine with Firstjob table but not secondjob table.

Generated error message:

(1 row(s) affected)

(1 row(s) affected)

Msg 547, Level 16, State 0, Line 6

The INSERT statement conflicted with the FOREIGN KEY constraint "Personnel_Secondjob". The conflict occurred in database "test", table "dbo.Personnel", column 'IDPersonnel'.

The statement has been terminated.

INSERTINTO dbo.Personnel

(Name)

VALUES

('Jon')

insert

into Firstjob(Designation, Employer, YearWorking, IDPersonnel)

values

('Teachier,'Gam','7thn',scope_identity())

insert

into Secondjob(Designation, Employer, YearWorking, IDPersonnel)

values

('Musician','KKSB','8thn',scope_identity())

any suggestions...

Declare @.id1int, @.id 2intINSERT INTO dbo.Personnel (Name)VALUES ('Jon')SELECT @.ID1 = SCOPE_IDENTITY()insert into Firstjob(Designation, Employer, YearWorking, IDPersonnel)values ('Teachier', 'Gam', '7thn', @.ID1) SELECT @.id2 = SCOPE_IDENTITY() insert into Secondjob(Designation, Employer, YearWorking, IDPersonnel) values ('Musician', 'KKSB', '8thn', @.ID2)
|||

it generate an error:

Msg 547, Level 16, State 0, Line 9

The INSERT statement conflicted with the FOREIGN KEY constraint "Personnel_PnglmnKerja2". The conflict occurred in database "test", table "dbo.Personnel", column 'IDPersonnel'.

The statement has been terminated.

i changed line 5 to
SELECT @.id2= @.ID1

or reduce the code to

SELECT @.ID1 = SCOPE_IDENTITY()
insert into Firstjob(Designation, Employer, YearWorking, IDPersonnel)values ('Teachier', 'Gam', '7thn', @.ID1)
insert into Secondjob(Designation, Employer, YearWorking, IDPersonnel) values ('Musician', 'KKSB', '8thn', @.ID1)

and it worked... thanx for the idea i'm just beginner,learning mssql through forums & ebook. I really appreciate it

do u foresee any problem if many people try to insert their data concurently?10-20 people at the same time

Designing Crystal Report with Brought forward value

Please i am new to crystal report design even though I have been able to design some simple reports. I would appreciate your kind assistance.

I have a crystal report from VB.Net that has series of columns (fields) generated from the following two tables.

1. tblAgt - Table
fconsole (float field)
fagent
B1

2. tblDebit - Table
fmending (Date field)
ActNo
fagent
ftrans
fgrssprem (float field)
Comm
The report has the following format

Date: 01/01/2004 To 31/12/2004
Account No: 38000 To 38092

Balance bf: 00.00

fmending ActNo Fagent ftr fgrssprem Comm. Net Amt
02/02/04 38837 db001 DR 5,000.00 350.00 4,650
02/07/04 38838 db002 CR 15,000.30 200.00 15,200.30
03/02/02 29388 db003 pyt 2,000.00 100.00 1,900.00
--------------------------

The Date and the Accounts Group header were generated with the parameter fields (Range)

The Date Range (StartDate & EndDate) header
The Account Range (StartAcct & EndAcct) header

The DB or CR or Pyt entry determines whether the fgrssprm is negative or positive e.g. To get the Netamt

if ftrans = CR, then Comm is added
if ftrans = DR, then Comm is deducted

The Balance bf: is where I am having a problem with because it is suppose
to be generated from all fgrssprem that falls before StartDate eg. 1/01/2004
ie. fmending(tablefield) < startdate (parameter field)

Balance bf = sum(fgrssprem(tbldebit) is added to fconsole in table (tblagt) ie. Balance bf = fgrssprem + fconsole

I am trying to filter for all the dates that is less than startdate and to get the sum of fgrssprem is giving me 0.00 as my result.

I would be greatful if you could put me through.

Thanks

fieYou need to write a query in the Back end and design the report using that query which you should store it as Stored Procedure. What is the Database you are using?

Designing category system

Hi,

I am trying to design tables for managing category system.

In my inventory management system, I have a receive form, where I have to enter a product from a subcategory of a category.

I can't figuire out how should i design my tables. Am I correct with these tables -

Products Table - ProdID, ProdName, CatID, SCatID
Category Table - CatID, CatName
SubCategory Table - SCatID, SCatName

I can't show only the subCategories associated with a Category. What will be the design?

Also in the Receive form, which one will be logical? Should I select a category first, and related subCategories appears, and then product list form that subcategory appear?

Or should I select the product first, then categories and subCategories should appear?

Thanx a lot in advance for your help.

Regards
Kapalic

It depends how your hierarchy is,
suppose if your hierarchy follows ,

Category
|- Sub-Category
|- Product


Then you can go for following design,

Category -> CatId, CatName, ParentCatId
Where
CatId Primary key
ParentCatId foreign Key of CatId

(if ParentCatid is null then Category otherwise Sub Category)

Product -> ProductId, CatId
Where
CatId is Foregitn key of Category(CatId)

Regarding selection,
Product -> Sub-Category is ONE ON ONE relation
Sub-Cateogry -> Category is ONE ON ONE Relation

But,
Category -> Sub-Category is ONE To MANY relation
Sub-Cateogry -> Product is ONE ON MANY relation

Again its depends how your business rules defines.

|||

Hi ManiD,

Thnx for your reply! I will use the table structure u provided. This is much more logical.

And regarding to choosing fields, i do not have any binding other than existance of category and subcategory id. I just want an expert openion on which approach will be better for the users and developers perspective.

Regards
Kapalic

Designing calendar databases

Is there a best practice/sample database design for creating database applications for scheduling events?

I am looking at creating an online work schedule using the .net calendar control tied back to a SQL Server database (think Outlook Calendar). I am at a loss as to how to efficiently design the database. Will I need to create an entry for every day? Is it prudent to use a datetime value for a primary key (I would have to whack the time portion)? How does one handle the number of days in a month/year?

Anyhoo... I would greatly appreciate any ideas/resources on how to design a database of this type.

Thanks in advance.I can't see any reason to have an entry for every day. Why have an entry if no events are scheduled for a certain day? Just store the events in an event table with a date as one of the columns.|||I am also, have you had any luck?|||You probably have a solution to this, but I was tasked with creating a calendar to schedule meeting rooms as one of my first projects for my current employer.

My table calendar has the following design.

CalendarID, int, autoinc
calendarDateTime, datetime
Appointment, varchar, 50
Reservedby, varchar, 50
Duration, varchar, 50
Freetime, varchar, 50
RoomValues, varchar, 50
AppointmentTime, varchar, 50

Each appointment is it's own row. The asp.net pages check to see if a appointment exists at the time the user selects, if not, it checks the duration which is in 1/2 hour increments if there is an overlap it won't enter the appointment. Otherwise if the time is free it inserts the record. I then query all the appointments for the day and build a table to display the information in a graphical way, Green background for free time, and yellow for occupied. I only display from 8:00AM to 5:00PM on the webpage, but allow scheduling to be anytime.

I hope this helps. BTW, it has been working like a charm since the first week I started here back in March.

Greg

Designing application using access 2000

I desperately need help. I am new to database design and I am using John viescas book Building microsoft access applications. Idon't know where or how to implement the codes in order to create an application.

The book does not give practical examples as to how to actually design the individual function of the database. Any ideas will be greatly welcomed as I am getting quite frustrated just reading meaningless text.

Hi,

this is no Acess group the "SQL Server Data Access" title mean Data Access to SQL Server. I think you are better occupied posting in a Access group like the one which can be found on the public Microsoft newsservers.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||if you want to do database design with sql server. BOL or books online which ships with the product is a good place to start.

Designing Aggregations

Does anyone know of a way to copy aggregations in the BI Studio?

I know you can copy aggregations in management studio after the cube is deployed...

Trying to do it at design time.

Thanks

Mark

You can switch to the "Code View" in BI dev studio and copy following property

<AggregationDesignID>YourAggregationDesignHere</AggregationDesignID>

From one partition to another.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Designing Aggregations

I have a fairly large partition (100M rows, 30 measures) and am attempting to create aggregations through the Aggregation Design Wizard. Regardless of the option I select, either percent or file size, the wizard always completes after designing only about 50 aggregtions for 0% and only 200kb. I cannot believe that to be right. On a much smaller partition I created about 600 aggregations to 30% for 2GB.

I've double checked to ensure I have all of my dimension attribute relationships defined.

Any ideas why I cannot get the large partition to build the aggregations or why it completes after building about 50? I have plenty of disk space and and cube processing time is not an issue, so I would like to create up to 25-30GB of aggregations.

Thanks

Have you established your attribute relationships?

WIthout them the system does not know that natural hierarchies may be available and by default it only creates aggregations along natural hierarchies.

_-_-_ Dave

|||

Thanks Dave, but I have established the attribute relationships. What confuses me is that the wizard shows that it will create about 250 aggregations, 0%, 125kb. I use the option to manually stop the aggregation design (but never do. I let if finish on its own) and it always comes out roughly the same.

When I process the partition I can see that the aggregations are being created. When I look in the file system I see a bunch of .tmp files being created (e.g. AggMerge_5800_54_8s64d_28.tmp), all of them for about 1.5GB. I eventually run out of space on the drive and the processing fails.

All together these .tmp files take about 150GB. The source database is only about 200GB.

Any thoughts? Ideas? The aggregation design wizard tells me the aggregations will take up about 125kb, but the .tmp files tell me something different.

Designing a Report without Dataset

Hello

We are trying to create an app where we pass dynamically a dataset (from our form in C#) to our {report}.rdl file.

We are having doubts about something.

How can we design the actual report if we don't have the datasource until runtime? The reason to do this is due to our complex calculations of data which becomes almost impossible to achieve in a T-SQL environment.

I know with a lot of patience and time (we don't have both) we can achieve it, but even though, we would need to process some data in the client side.

So, the question is... is it possible to design a report without a Dataset? I know we can drag the controls on the layout window, but we won't be able to test it. IS there any workaroung about this?

Thank you

Assuming that you use the ReportViewer control in local mode and you have the dataset schema, you can lay out the report from the schema, e.g. from a typed dataset. You may find the following article helpful.|||

Ok, let's get more detailed about this.

We have our SQL Server. let's call it SQL. We have our clients using our software. In our software we have a winform with a ReportViewer object.

Ok. We want that winform to load dynamically the reports stored in our SQL Server. We want to pass a parameter to the winform, which is the report name, then according to that parameter we are going to load a report. OK. Then, Once we know what report we want to load, we want to be able to pass a "runtime dataset" (a dataset created at runtime) Why? because of the complexity of our calculations we prefer to retrieve the data raw from the SQL, then process it in our client software and then pass it to our report (which we have already selected and it's waiting to be shown in the Report Viewer).

We thought the steps were something like create an instance of a LocalReport, then get the Definition from the report (stored in the SQL Server) and pass it to this LocalReport, then create a ReportDataset instance and pass the data the way we want it, then pass that ReportDataset to the LocalReport and then tell the ReportViewer to show that instance of the LocalReport.

That's in detail what we want. So far we haven't been able to achieve it, but we keep on trying. Any suggestion is welcome.

By the way, does anyone can address me to this new feature of SQL2005 for writing code in C#. Maybe that's a solution for our "Processin Stage".

Regards

|||

We want that winform to load dynamically the reports stored in our SQL Server.

I interpret this as you keep the report definitions in a SQL Server database. You don't have/need a Report Server, correct? You need to:

1. Save the report definition to a local file.

2. Generate the dataset.

3. Configure the report viewer in local mode and bind the dataset to it.

designing a Microsoft cluster

What is the best way to set up a 2 node cluster for SQL server? We are
just beginning and a couple of the apps. One that used DFS and one
that mapped a drive were complaining about the clustered environment.
I would recommend using Microsoft Virtual Server 2005 to create a test
cluster and learn how to maintain and support SQL. I am not a true SQL guy,
so I can't address your DFS and SQL issue.
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering Website
http://www.msmvps.com/clustering - Blog
http://www.clusterhelp.com - Cluster Training
<nate@.well.com> wrote in message
news:4321e08a.85197056@.msnews.microsoft.com...
> What is the best way to set up a 2 node cluster for SQL server? We are
> just beginning and a couple of the apps. One that used DFS and one
> that mapped a drive were complaining about the clustered environment.

Designing a generic database API

Hi,

My current project requires me to convert a mysql based software to a more generic one. I started by designing separate db class files and separated the lower level connection queries from the business logic. By doing this, I now have mssql.class, mysql.class, sqllite.class etc..

But am not sure how to handle sql functions in queries. For instance, one of my queries need the use of a date function to add minutes to a db field.

In mysql, I accomplish this using

dbfield+interval '$arg' minute between date1 and date1

But in mssql I cannot use this type of query. It seems I'll have to use date_add() function. How do I handle this situation?

My frontend scripting language is php

Thanks d'advance
CeliaI would create a function in your PHP code that takes two arguments, a "date" and an "adder" to the date. That way you can "cook" them as needed for each database engine, while keeping the PHP quite generic.

-PatP

Designing a fact table to hold customer-product ownership by day

If I'm designing a fact table to hold customer-product ownership by day, can one somehow get by with just storing customer purchase dates and return dates, rather than a record for each day the customer owns a product?

I need to make sure that if a customer bought a product in Jan and returned it 1 month later, but then bought it again in April - that they show up as having that item in
Jan and April - to date (but excluding Feb, March)

One thing that will be tough is the potential for this to happen several times with the same customer, but still showing all gaps of not having product. If a date dimension is not used, the I'd really like to take the customer's current status for a product - is it possible to do this?


Also, another question, speaking of customer counts and rollup
once it's determined that a customer has a certain product on x day (count of 1) and doesn't have a product on a different day (count of -1),
how would one determine that for the level above product, -subcategory-, that there were 5 customers that had Accessories?

I see that adventure works uses distinct count to make up customer count, but what about when returns are entered into the picture?
I'm thinking of doing them as -1, but maybe there's a better way to handle them and ultimately, the 'distinct customer count' rollup to higher levels?

I realize this post contains a lot of questions - if I can get at least one answered for starters, that would be awesome.

Hi,

if you contact me by mail and send me more detail and if it's possible some data I can try to figure out a possible solution. (If you can wait few days)

francesco.dechirico(AT)fastwebnet.it

|||

Still looking into this problem - months later Smile

With a fact table like:

Customer Product Date Qty

1 1 1/1/2005 1

1 1 3/2/2005 -1

1 2 4/1/2005 1

I'd like to have a query show that a customer is active on dates 1/1/2005-3/1/2005, and from 4/1/2005 on... this should also be done by distinct count of customer ID, but down to product if possible.

Here is an example mdx statement I composed, but the results aren't exactly what I'm seeking. Yes, it adds up Invoice Qty, but I was hoping to 'create' the date rows in between.

with member x

as DistinctCount(sum({null:[Transaction Date].[Calendar Date].CurrentMember}, [Invoice Qty]), Customer.Customer.[Customer ID].CurrentMember)

member y as [Transaction Date].[Calendar Date].CurrentMember.UniqueName

select {[invoice sales],[Measures].[Invoice Qty], x, y} on 0,

[Transaction Date].[Calendar Month].[Calendar Month] on 1

from sales

where (customer.customer.&[1])

|||

Any ideas on this one?

Mainly, I'm looking for something to create the non existant date rows in the output. Whether it be a script SCOPE or calculated member..

|||

Ok, I got a lot further after reading the ideas in this post

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1205862&SiteID=1

I've defined a measure to be Cumulative Qty Shipped - summing up all shipped qty to the day in question.

Then another measure (CustomerCount) that does: iif([Cumulative Qty Shipped] > 0, 1, NULL) -- in order to make sure that a customer only gets a tally of 1, not any higher.

Now, what I'm concerned about is the bleeding that happens. ie:

If looking at 2 customers, the execution path of AS is to sum all qty shipped to the current date section, then evaluate the logic: iif([Cumulative Qty Shipped] > 0, 1, NULL)

This would also happen if looking at 1 customer and multiple products. All of the products' qty would be summed, then evaluated for > 0..

Is there a way to sort of turn this around so that the calculation is first done on strictly customer and product, then doing the iif([Cumulative Qty Shipped] > 0, 1, NULL) check?

Plus another behavior needed is 'distinct' customer count. If looking at the all products level, and a customer owns 3 products, they should still only be counted once. If looking the members of Products, then the customer could be tallied once per product.

|||

I tried another script scope, hoping that it would work to cover the needs discussed, but it did not.

This is what I'd used. Hopefully it will spark some ideas from others! Smile

SCOPE (Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

this = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

ENDSCOPE;

and differently:

SCOPE(Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

Measures.CustomerCount = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

ENDSCOPE;

|||

I hate to be responding so many times in a row, but I'm looking for some direction on this one.

Thank you!!

Designing a fact table to hold customer-product ownership by day

If I'm designing a fact table to hold customer-product ownership by day, can one somehow get by with just storing customer purchase dates and return dates, rather than a record for each day the customer owns a product?

I need to make sure that if a customer bought a product in Jan and returned it 1 month later, but then bought it again in April - that they show up as having that item in
Jan and April - to date (but excluding Feb, March)

One thing that will be tough is the potential for this to happen several times with the same customer, but still showing all gaps of not having product. If a date dimension is not used, the I'd really like to take the customer's current status for a product - is it possible to do this?


Also, another question, speaking of customer counts and rollup
once it's determined that a customer has a certain product on x day (count of 1) and doesn't have a product on a different day (count of -1),
how would one determine that for the level above product, -subcategory-, that there were 5 customers that had Accessories?

I see that adventure works uses distinct count to make up customer count, but what about when returns are entered into the picture?
I'm thinking of doing them as -1, but maybe there's a better way to handle them and ultimately, the 'distinct customer count' rollup to higher levels?

I realize this post contains a lot of questions - if I can get at least one answered for starters, that would be awesome.

Hi,

if you contact me by mail and send me more detail and if it's possible some data I can try to figure out a possible solution. (If you can wait few days)

francesco.dechirico(AT)fastwebnet.it

|||

Still looking into this problem - months later Smile

With a fact table like:

Customer Product Date Qty

1 1 1/1/2005 1

1 1 3/2/2005 -1

1 2 4/1/2005 1

I'd like to have a query show that a customer is active on dates 1/1/2005-3/1/2005, and from 4/1/2005 on... this should also be done by distinct count of customer ID, but down to product if possible.

Here is an example mdx statement I composed, but the results aren't exactly what I'm seeking. Yes, it adds up Invoice Qty, but I was hoping to 'create' the date rows in between.

with member x

as DistinctCount(sum({null:[Transaction Date].[Calendar Date].CurrentMember}, [Invoice Qty]), Customer.Customer.[Customer ID].CurrentMember)

member y as [Transaction Date].[Calendar Date].CurrentMember.UniqueName

select {[invoice sales],[Measures].[Invoice Qty], x, y} on 0,

[Transaction Date].[Calendar Month].[Calendar Month] on 1

from sales

where (customer.customer.&[1])

|||

Any ideas on this one?

Mainly, I'm looking for something to create the non existant date rows in the output. Whether it be a script SCOPE or calculated member..

|||

Ok, I got a lot further after reading the ideas in this post

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1205862&SiteID=1

I've defined a measure to be Cumulative Qty Shipped - summing up all shipped qty to the day in question.

Then another measure (CustomerCount) that does: iif([Cumulative Qty Shipped] > 0, 1, NULL) -- in order to make sure that a customer only gets a tally of 1, not any higher.

Now, what I'm concerned about is the bleeding that happens. ie:

If looking at 2 customers, the execution path of AS is to sum all qty shipped to the current date section, then evaluate the logic: iif([Cumulative Qty Shipped] > 0, 1, NULL)

This would also happen if looking at 1 customer and multiple products. All of the products' qty would be summed, then evaluated for > 0..

Is there a way to sort of turn this around so that the calculation is first done on strictly customer and product, then doing the iif([Cumulative Qty Shipped] > 0, 1, NULL) check?

Plus another behavior needed is 'distinct' customer count. If looking at the all products level, and a customer owns 3 products, they should still only be counted once. If looking the members of Products, then the customer could be tallied once per product.

|||

I tried another script scope, hoping that it would work to cover the needs discussed, but it did not.

This is what I'd used. Hopefully it will spark some ideas from others! Smile

SCOPE (Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

this = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

END SCOPE;

and differently:

SCOPE (Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

Measures.CustomerCount = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

END SCOPE;

Designing a fact table to hold customer-product ownership by day

If I'm designing a fact table to hold customer-product ownership by day, can one somehow get by with just storing customer purchase dates and return dates, rather than a record for each day the customer owns a product?

I need to make sure that if a customer bought a product in Jan and returned it 1 month later, but then bought it again in April - that they show up as having that item in
Jan and April - to date (but excluding Feb, March)

One thing that will be tough is the potential for this to happen several times with the same customer, but still showing all gaps of not having product. If a date dimension is not used, the I'd really like to take the customer's current status for a product - is it possible to do this?


Also, another question, speaking of customer counts and rollup
once it's determined that a customer has a certain product on x day (count of 1) and doesn't have a product on a different day (count of -1),
how would one determine that for the level above product, -subcategory-, that there were 5 customers that had Accessories?

I see that adventure works uses distinct count to make up customer count, but what about when returns are entered into the picture?
I'm thinking of doing them as -1, but maybe there's a better way to handle them and ultimately, the 'distinct customer count' rollup to higher levels?

I realize this post contains a lot of questions - if I can get at least one answered for starters, that would be awesome.

Hi,

if you contact me by mail and send me more detail and if it's possible some data I can try to figure out a possible solution. (If you can wait few days)

francesco.dechirico(AT)fastwebnet.it

|||

Still looking into this problem - months later Smile

With a fact table like:

Customer Product Date Qty

1 1 1/1/2005 1

1 1 3/2/2005 -1

1 2 4/1/2005 1

I'd like to have a query show that a customer is active on dates 1/1/2005-3/1/2005, and from 4/1/2005 on... this should also be done by distinct count of customer ID, but down to product if possible.

Here is an example mdx statement I composed, but the results aren't exactly what I'm seeking. Yes, it adds up Invoice Qty, but I was hoping to 'create' the date rows in between.

with member x

as DistinctCount(sum({null:[Transaction Date].[Calendar Date].CurrentMember}, [Invoice Qty]), Customer.Customer.[Customer ID].CurrentMember)

member y as [Transaction Date].[Calendar Date].CurrentMember.UniqueName

select {[invoice sales],[Measures].[Invoice Qty], x, y} on 0,

[Transaction Date].[Calendar Month].[Calendar Month] on 1

from sales

where (customer.customer.&[1])

|||

Any ideas on this one?

Mainly, I'm looking for something to create the non existant date rows in the output. Whether it be a script SCOPE or calculated member..

|||

Ok, I got a lot further after reading the ideas in this post

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1205862&SiteID=1

I've defined a measure to be Cumulative Qty Shipped - summing up all shipped qty to the day in question.

Then another measure (CustomerCount) that does: iif([Cumulative Qty Shipped] > 0, 1, NULL) -- in order to make sure that a customer only gets a tally of 1, not any higher.

Now, what I'm concerned about is the bleeding that happens. ie:

If looking at 2 customers, the execution path of AS is to sum all qty shipped to the current date section, then evaluate the logic: iif([Cumulative Qty Shipped] > 0, 1, NULL)

This would also happen if looking at 1 customer and multiple products. All of the products' qty would be summed, then evaluated for > 0..

Is there a way to sort of turn this around so that the calculation is first done on strictly customer and product, then doing the iif([Cumulative Qty Shipped] > 0, 1, NULL) check?

Plus another behavior needed is 'distinct' customer count. If looking at the all products level, and a customer owns 3 products, they should still only be counted once. If looking the members of Products, then the customer could be tallied once per product.

|||

I tried another script scope, hoping that it would work to cover the needs discussed, but it did not.

This is what I'd used. Hopefully it will spark some ideas from others! Smile

SCOPE (Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

this = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

END SCOPE;

and differently:

SCOPE (Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

Measures.CustomerCount = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

END SCOPE;

Designing a fact table to hold customer-product ownership by day

If I'm designing a fact table to hold customer-product ownership by day, can one somehow get by with just storing customer purchase dates and return dates, rather than a record for each day the customer owns a product?

I need to make sure that if a customer bought a product in Jan and returned it 1 month later, but then bought it again in April - that they show up as having that item in
Jan and April - to date (but excluding Feb, March)

One thing that will be tough is the potential for this to happen several times with the same customer, but still showing all gaps of not having product. If a date dimension is not used, the I'd really like to take the customer's current status for a product - is it possible to do this?


Also, another question, speaking of customer counts and rollup
once it's determined that a customer has a certain product on x day (count of 1) and doesn't have a product on a different day (count of -1),
how would one determine that for the level above product, -subcategory-, that there were 5 customers that had Accessories?

I see that adventure works uses distinct count to make up customer count, but what about when returns are entered into the picture?
I'm thinking of doing them as -1, but maybe there's a better way to handle them and ultimately, the 'distinct customer count' rollup to higher levels?

I realize this post contains a lot of questions - if I can get at least one answered for starters, that would be awesome.

Hi,

if you contact me by mail and send me more detail and if it's possible some data I can try to figure out a possible solution. (If you can wait few days)

francesco.dechirico(AT)fastwebnet.it

|||

Still looking into this problem - months later Smile

With a fact table like:

Customer Product Date Qty

1 1 1/1/2005 1

1 1 3/2/2005 -1

1 2 4/1/2005 1

I'd like to have a query show that a customer is active on dates 1/1/2005-3/1/2005, and from 4/1/2005 on... this should also be done by distinct count of customer ID, but down to product if possible.

Here is an example mdx statement I composed, but the results aren't exactly what I'm seeking. Yes, it adds up Invoice Qty, but I was hoping to 'create' the date rows in between.

with member x

as DistinctCount(sum({null:[Transaction Date].[Calendar Date].CurrentMember}, [Invoice Qty]), Customer.Customer.[Customer ID].CurrentMember)

member y as [Transaction Date].[Calendar Date].CurrentMember.UniqueName

select {[invoice sales],[Measures].[Invoice Qty], x, y} on 0,

[Transaction Date].[Calendar Month].[Calendar Month] on 1

from sales

where (customer.customer.&[1])

|||

Any ideas on this one?

Mainly, I'm looking for something to create the non existant date rows in the output. Whether it be a script SCOPE or calculated member..

|||

Ok, I got a lot further after reading the ideas in this post

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1205862&SiteID=1

I've defined a measure to be Cumulative Qty Shipped - summing up all shipped qty to the day in question.

Then another measure (CustomerCount) that does: iif([Cumulative Qty Shipped] > 0, 1, NULL) -- in order to make sure that a customer only gets a tally of 1, not any higher.

Now, what I'm concerned about is the bleeding that happens. ie:

If looking at 2 customers, the execution path of AS is to sum all qty shipped to the current date section, then evaluate the logic: iif([Cumulative Qty Shipped] > 0, 1, NULL)

This would also happen if looking at 1 customer and multiple products. All of the products' qty would be summed, then evaluated for > 0..

Is there a way to sort of turn this around so that the calculation is first done on strictly customer and product, then doing the iif([Cumulative Qty Shipped] > 0, 1, NULL) check?

Plus another behavior needed is 'distinct' customer count. If looking at the all products level, and a customer owns 3 products, they should still only be counted once. If looking the members of Products, then the customer could be tallied once per product.

|||

I tried another script scope, hoping that it would work to cover the needs discussed, but it did not.

This is what I'd used. Hopefully it will spark some ideas from others! Smile

SCOPE (Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

this = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

END SCOPE;

and differently:

SCOPE (Measures.CustomerCount, [Product].[Product].[Product], [Customer].[Customer].[Customer]);

Measures.CustomerCount = IIF([Cumulative Qty Shipped] > 0, 1, NULL);

END SCOPE;

Designing a database within a database... design question storing data...

I have a system that basically stores a database within a database (I'm
sure lots have you have done this before in some form or another).

At the end of the day, I'm storing the actual data generically in a
column of type nvarchar(4000), but I want to add support for unlimited
text. I want to do this in a smart fashion. Right now I am leaning
towards putting 2 nullable Value fields:

ValueLong ntext nullable
ValueShort nvarchar(4000) nullable

and dynamically storing the info in one or the other depending on the
size. ASP.NET does this exact very thing in it's Session State model;
look at the ASPStateTempSessions table. This table has both a
SessionItemShort of type varbinary (7000) and a SessionItemLong of type
Image.

My question is, is it better to user varbinary (7000) and Image? I'm
thinking maybe I should go down this path, simply because ASP.NET does,
but I don't really know why. Does anyone know what would be the benifit
of using varbinary and Image datatypes? If it's just to allow saving of
binary data, then I don't really need that right now (and I don't think
ASP.NET does either). Are there any other reasons?

thanks,
dave>I have a system that basically stores a database within a database (I'm
> sure lots have you have done this before in some form or another).

Please explain. What form is the data you are storing? If it isn't
represented relationally then why use SQL Server?

--
David Portas
SQL Server MVP
--|||Dave (chakachimp@.yahoo.com) writes:
> My question is, is it better to user varbinary (7000) and Image? I'm
> thinking maybe I should go down this path, simply because ASP.NET does,
> but I don't really know why. Does anyone know what would be the benifit
> of using varbinary and Image datatypes? If it's just to allow saving of
> binary data, then I don't really need that right now (and I don't think
> ASP.NET does either). Are there any other reasons?

Depends on the data you are storing. Since you talk about a "database with
a database", my initial reaction was you would use image, since I assumed
that the database is a binary file, complete with indexes, integer numbers,
and whatever.

But if the "database" is represented in text, for instance an XML document,
then there is no reason to use binary datatypes.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||I'm sorry, I need to elaborate. When I say database within a database,
I don't meen storing the actual database in a binary column or storing
XML in a column, instead I mean defining the structure of data within a
set of tables.

Instead of a concrete table such as Member with 3 columns: MemberID
int, FirstName varchar(25), LastName varchar(25), it is defined as an
abstract table that's defined across a series of tables. One row of any
of my abstract table actually lives (potentially) in several rows of a
sort of "Value" table. This "Value" table contains one column
(Varchar(4000)) that actually stores the value of the data item.

In our system we have over 15 abstract objects (Member being one of
them), so I know people will begin to question the architecture, but
that is not my point here... We do this for many reasons

1) We must store history on all changes (we write medical software)
2) We must encrypt the data and this allows a generic way to do this
(just flip a bit)
3) Our application will soon allow it's users to create user-defined
table and this is set up perfectly for that since it would only require
DML to achieve this (not DDL)
4) Speed isn't that important, right now our product has 10 users max.
Even if it became an issue we could solve this easily...

thanks,
dave|||Dave (chakachimp@.yahoo.com) writes:
> I'm sorry, I need to elaborate. When I say database within a database,
> I don't meen storing the actual database in a binary column or storing
> XML in a column, instead I mean defining the structure of data within a
> set of tables.
> Instead of a concrete table such as Member with 3 columns: MemberID
> int, FirstName varchar(25), LastName varchar(25), it is defined as an
> abstract table that's defined across a series of tables. One row of any
> of my abstract table actually lives (potentially) in several rows of a
> sort of "Value" table. This "Value" table contains one column
> (Varchar(4000)) that actually stores the value of the data item.
> In our system we have over 15 abstract objects (Member being one of
> them), so I know people will begin to question the architecture, but
> that is not my point here... We do this for many reasons
> 1) We must store history on all changes (we write medical software)
> 2) We must encrypt the data and this allows a generic way to do this
> (just flip a bit)
> 3) Our application will soon allow it's users to create user-defined
> table and this is set up perfectly for that since it would only require
> DML to achieve this (not DDL)
> 4) Speed isn't that important, right now our product has 10 users max.
> Even if it became an issue we could solve this easily...

Thanks for the elaboration, but I am not sure that this really provided
any more actual useful information to answer the question. "The database
within in a database", is thuse some sort of object that cannot be described
in a single table - nothing strange with that Order + OrderDetails is a
classic example.

But if I remove the veil about databases within database, and just take
the core question of yours: what datatype should use to save text data,
the answer is (n)varchar or (n)text, depening on your need to support
Unicode and the size limits of the data.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Let me completely rephrase my approach...

If you've ever installed the sql data model for ASP.NET that resides in
sql server, you'll notice that Microsoft has a table called
ASPStateTempSessions. There are two columns that hold the encrypted
session data of the user. These two columns are:

varbinary(7000)
Image

and they are each nullable. Depending on the size of the Session data,
one or the other column is used since Blob columns (such as Image,
Text, etc...) are inefficient. Using the Session in ASP.NET you'll
notice that it consists of strings only, so why did Microsoft decide to
use these types? Is there some effieciency thing? Or were they planning
on simply supporting possible binary data in the future.

-dave|||Dave (chakachimp@.yahoo.com) writes:
> If you've ever installed the sql data model for ASP.NET that resides in
> sql server, you'll notice that Microsoft has a table called
> ASPStateTempSessions. There are two columns that hold the encrypted
> session data of the user. These two columns are:
> varbinary(7000)
> Image
> and they are each nullable. Depending on the size of the Session data,
> one or the other column is used since Blob columns (such as Image,
> Text, etc...) are inefficient. Using the Session in ASP.NET you'll
> notice that it consists of strings only, so why did Microsoft decide to
> use these types? Is there some effieciency thing? Or were they planning
> on simply supporting possible binary data in the future.

Sorry, I have zero knowledge about ASP .Net, so I cannot answer any
question about its design.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Been Working on the AspState database, some information indicates that
the transfer of the string data is being done as a binary stream for
efficiency, thus requiring a binary db datatype to store it.

*** Sent via Developersdex http://www.developersdex.com ***

Designing a Code Table

I have a language table 'CODE_LANGUAGE' where we defines languages.
CREATE TABLE [dbo].[CODE_LANGUAGE] (
[language_id] [smallint] NOT NULL PRIMARY KEY CLUSTERED,
[language_name] [varchar(20)] NOT NULL
) ON [PRIMARY]
GO
I need to design a table for Location codes "CODE_LOCATION". This table need
to have these attributes:
location_id
location_name
location_desc
active_flag
external_value
Problem is that location_desc can be in English or French or Spanish. So
what would be the best way to resolve this problem?
I can think of two solutions:
Solution1:
=======
Add 2 columns in 'CODE_LOCATION' table: "id" column and "language_id"
column. The "id" column will be an identity column and will be the primary
key. The "language_id" column will be foreign key to "language_id" column in
'CODE_LANGUAGE' table.
CREATE TABLE [dbo].[CODE_LOCATION] (
[id] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY CLUSTERED,
[location_id] [smallint] NOT NULL ,
[location_name] [varchar(20)] NOT NULL ,
[language_id] [smallint] NOT NULL,
[location_desc] [varchar(255)] NOT NULL ,
[active_flag] [tinyint] NOT NULL ,
[external_value] [varchar(10)] NULL
) ON [PRIMARY]
GO
Solution2:
=======
Create a seperate table "LANGUAGE_LOCATION" which stores description of
location codes in different languages. Its primary key will be foreign key
in 'CODE_LOCATION' table.
CREATE TABLE [dbo].[LANGUAGE_LOCATION] (
[lang_loc_id] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY CLUSTERED,
[language_id] [smallint] NOT NULL ,
[location_id] [smallint] NOT NULL ,
[location_desc] [varchar(255)] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CODE_LOCATION] (
[location_id] [smallint] NOT NULL PRIMARY KEY CLUSTERED,
[location_name] [varchar(20)] NOT NULL ,
[lang_loc_id] [int] NOT NULL REFERENCES LANGUAGE_LOCATION(lang_loc_id),
[active_flag] [tinyint] NOT NULL ,
[external_value] [varchar(10)] NULL
) ON [PRIMARY]
GO
Which solution is better and why?
It is my understanding that both solutions are in 3rd normal form. Is it
correct?
Do you guys have any better solution?
ThanksI'm trying to understand the problem better.

>Problem is that location_desc can be in English or French or Spanish. So
>what would be the best way to resolve this problem?
For one location, is there going to be ONE location_desc in ONE
language, or several with one in EACH language?
Roy|||Let's fix that first table. You should have found the ISO language
codes when you did research -- in about 3 seconds with a slow
connection to Google. The codes are CHAR(3).
Is there a very good reason you threw out all the ISO-11179 conventions
about putting the attribute in a postfix? What is that reason?
Oh yes, the "magical UNIVERSAL identity exposed physical locator" that
newbies use to spit on RDBMS and Dr. Codd.
I also see that you want to write with flags like SQL was assembly or C
code. Major mindset error.
Your next mistake will be saying things like "XX_loc_id" not knowing
that an attribute cannot be both an identifier and a location.
One column for each language in the same table?|||On 23 Feb 2006 18:19:38 -0800, "--CELKO--" <jcelko212@.earthlink.net>
wrote:

>One column for each language in the same table?
And when the requirement to add German and Italian comes along, what
then?
Roy 8-)|||"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:e9nsv1d96cbrv3qok72pb3schg8v0dce4m@.
4ax.com...
> I'm trying to understand the problem better.
>
> For one location, is there going to be ONE location_desc in ONE
> language, or several with one in EACH language?
> Roy
For one location there will be several location_desc with one in EACH
language.|||"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1140747578.311798.118740@.v46g2000cwv.googlegroups.com...
> Let's fix that first table. You should have found the ISO language
> codes when you did research -- in about 3 seconds with a slow
> connection to Google. The codes are CHAR(3).
>
I did not know about ISO language codes. After your email I research it and
decided that i dont want to use it. By using my table I can differentiate
between american english and canadian english.

> Is there a very good reason you threw out all the ISO-11179 conventions
> about putting the attribute in a postfix? What is that reason?
>
I did not know about ISO-11179 conventions. I am going to research these
naming conventions.

> Oh yes, the "magical UNIVERSAL identity exposed physical locator" that
> newbies use to spit on RDBMS and Dr. Codd.
>
This is part of Solution1 i come up with. I wrote this email to ask if this
is right approach. My guess is that you dont like Solution1. Am i right?

> I also see that you want to write with flags like SQL was assembly or C
> code. Major mindset error.
> Your next mistake will be saying things like "XX_loc_id" not knowing
> that an attribute cannot be both an identifier and a location.
>
> One column for each language in the same table?
>
For one location there will be several location_desc with one in EACH
language. So if there is Location 'Mississauga' then there could be 3
location_desc for it: one in US English; one in CAN French and one in
Spanish. Keeping this in mind please look at the 2 solutions I come up with
and answer these questions:
1) Which solution is better and why?
2) It is my understanding that both solutions are in 3rd normal form. Is it
correct?
3) Do you guys have any better solution?
Thanks|||>Solution2:
>=======
>Create a seperate table "LANGUAGE_LOCATION" which stores description of
>location codes in different languages. Its primary key will be foreign key
>in 'CODE_LOCATION' table.
>CREATE TABLE [dbo].[LANGUAGE_LOCATION] (
> [lang_loc_id] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY CLUSTERED,
> [language_id] [smallint] NOT NULL ,
> [location_id] [smallint] NOT NULL ,
> [location_desc] [varchar(255)] NOT NULL
> ) ON [PRIMARY]
>GO

>For one location there will be several location_desc with one in EACH
>language.
Then the proper solution is a table similar to LANGUAGE_LOCATION in
your second solution, but not quite. I would never, ever, create an
IDENTITY column on that table. You have a perfectly good PK in
(language_id,location_id). I can go along with surrogate keys in
circumstances that justify them, but this seems completely
inappropriate to me.
Roy

Designing "XML Proof" databases?

Hello All,
I'm fairly new to the XML game. I am designing a database that will contain
online books. Each book will be broken into parts, each part into chapters,
each chapter into sections, each section into... you get the idea. I think
this is the perfect opportunity for the XML data type in Yukon. However, I
did to put this database together in the next few weeks.
My question is whether there are any best practices for designing
traditional heirarchical databases today that will smoothly transition into
an XML future. (Books, articles, suggestions here, etc.?)
I need to have each text snippet as it's own record in one table (snippetID,
title, body, etc.) I was thinking that I would create a second table for the
heirarchy itself where I would maintain the relationships tied back to the
specific snippetID's. My plan was to use SQLXML to represent the data as XML
(which I think could drive a cool DHTML menu). But, I wonder if this is the
right approach given that yukon is around the corner (yet that I need this
before Yukon's release date?)
Thanks so much,
Brian
What do you do with the data once it is stored in the database?
Do you store and retrieve the document as a whole? In that case, I would
keep the document as an NTEXT or TEXT field depending on the encoding of the
XML and propagate some lookup info into other columns. This will be easily
converted into the XML datatype.
If you are planning on doing extensive reshaping and or selecting only
parts, you may want to partition the XML into separate components and then
do the same as above...
Best regards
Michael
"Brian Madden" <brian@.brianmadden.com> wrote in message
news:uF2NsxF3EHA.1396@.tk2msftngp13.phx.gbl...
> Hello All,
> I'm fairly new to the XML game. I am designing a database that will
> contain online books. Each book will be broken into parts, each part into
> chapters, each chapter into sections, each section into... you get the
> idea. I think this is the perfect opportunity for the XML data type in
> Yukon. However, I did to put this database together in the next few weeks.
> My question is whether there are any best practices for designing
> traditional heirarchical databases today that will smoothly transition
> into an XML future. (Books, articles, suggestions here, etc.?)
> I need to have each text snippet as it's own record in one table
> (snippetID, title, body, etc.) I was thinking that I would create a second
> table for the heirarchy itself where I would maintain the relationships
> tied back to the specific snippetID's. My plan was to use SQLXML to
> represent the data as XML (which I think could drive a cool DHTML menu).
> But, I wonder if this is the right approach given that yukon is around the
> corner (yet that I need this before Yukon's release date?)
> Thanks so much,
> Brian
>