Showing posts with label advice. Show all posts
Showing posts with label advice. Show all posts

Friday, March 23, 2012

Need expert help in database design..

Hello friends,I have to design a database for banking application,but it is my first db design so i need some expert advice.

Data base has some performance constraint i.e high output ,minimum query time,need to process 2 to 5 million transaction per day.

Further specification can be revealed if appropriate help is provided.

your advice will be of great help for me.

Thx

Are you requesting a 'paid' consultant to help you create a cohesive design, or, are you 'hoping' that a bunch of volunteers will take their time and help you do something that you are getting paid to do?

You know the problems that can occur when something is 'designed by committee'...

Feel free to put out YOUR design considerations and get feedback -but having a group of 'anonymous yahoos' (present company included) do your design for you is heading for disaster.

|||

Thankyou for replying to my question.

Here we are trying to design a solution for " KYC(know your customer )/AML(anti money laundering)" .These two terms stems from

various compliance in banking sector, i.e Bank secrecy ACT ,US patriotic act(if you are from America) and various other compliance related to financial industry.

We need to create a monitoring mechanism on various financial transactions(2-5 million per day,minimum requirement) either in real time or in batch mode.

In this mechanism we will monitor transactions on various predefined rules and rules using techniques of data mining.

The data related to various transaction is intended to be collected using integration services of sql server 2005.

I am looking for some volunteer,but one thing I can assure u that i will need avice only for some key areas('ll not vex u too much) i.e preventing foolish mistakes which can lead to desaster at later stage and some high performance(high data retrival speed in large database) related issues.

I am more concerned about the performance issue related to data base, you can imagin how big a bank cuctomer's database can be and data related to their every day transaction.

Plz let me know if you are intrested or can advice me some resource related to experienced data base design.

For helping hand.

Thx once again.

Gagan

|||


You are very welcome to post your questions, proposals for 'debate', and things to ponder. Some here may contribute, depending upon their time and interest.


However, I think that perhaps this isn't the best forum. I would consider the [ Transact SQL ] or [ Database Engine ] since they seem to have more 'traffic' -translating into readers and possible contributors.


There are a couple of documents referenced in this thread: http://forums.microsoft.com/MSDN/showpost.aspx?postid=1436785&siteid=1


Good Luck. (This thread is now closed.)

sql

Need Expert Help and Advice. Thank You.

Hello,

Consider I have a String:

Dim MyStringAs String ="Hello"
or an Integer:
Dim MyIntegerAs Integer = 100
or a class which its properties:
Dim MyClass As New MyCustomClassMyClass.Property1 ="Hello"MyClass.Property2 = Unit.Pixel(100)MyClass.Property3 = 100
Or even a control:
Dim MyLabelAs LabelMyLabel.Id ="MyLabel"MyLabel.CssClass ="MyLabelCssClass"

Is there a way to save a String, an Integer, a Boolean, a Class, a Control in an SQL database?

Something like:

Define something (Integer, String, Class, Control, etc)

Save in SQL 2005 Database

Later in code Retrive from database given its ID

Is this possible?

How should I do this?

What type of SQL 2005 table field should be used to store the information?

Thanks,

Miguel

Yes it is possible

You can serialize your object (some extra design work) and save as XML in XML field. The advantage is that you can search this XML on SQL server. Another solution is to save your object as binary data in image field or varbinary(max) (which is now recommended replacement for image field). You probably have to have another field in your database to identity your object.

Thanks

Need Emergency Advice

Dear All,

We have a big concern in our Database system. We have 2000 transactions
daily in our database. We need to replicate some how the database for
our fail over setup. I tried transactional replication at midnight but
our all systems locked and we had a lot of complaints from the
customers and It was taking a lot of time to snapshot part and I had to
abort it because of these reasons.
I need an advice how I can create a replication or is there any other
way to replicate or is there any way to do this process without
bothering the system? Please give me some advice and help..

Thanks
asa."laststubborn" <arafatsalih@.gmail.com> wrote in message
news:1147164897.180455.80350@.j33g2000cwa.googlegro ups.com...
> Dear All,
> We have a big concern in our Database system. We have 2000 transactions
> daily in our database. We need to replicate some how the database for
> our fail over setup. I tried transactional replication at midnight but
> our all systems locked and we had a lot of complaints from the
> customers and It was taking a lot of time to snapshot part and I had to
> abort it because of these reasons.

Why do the transactional replication only at midnight? Better off doing it
continually throughout the day.

And btw, 2000 transactions, unless they're huge, is trivial. I have systems
doing that per minute.

The other option is to look into log shipping.

There are scripts out there that let you do it even w/o Enterprise edition,
though it is then admittedly more manual.

> I need an advice how I can create a replication or is there any other
> way to replicate or is there any way to do this process without
> bothering the system? Please give me some advice and help..
> Thanks
> asa.|||Greg D. Moore (Strider) wrote:
> "laststubborn" <arafatsalih@.gmail.com> wrote in message
> news:1147164897.180455.80350@.j33g2000cwa.googlegro ups.com...
> > Dear All,
> > We have a big concern in our Database system. We have 2000 transactions
> > daily in our database. We need to replicate some how the database for
> > our fail over setup. I tried transactional replication at midnight but
> > our all systems locked and we had a lot of complaints from the
> > customers and It was taking a lot of time to snapshot part and I had to
> > abort it because of these reasons.
> Why do the transactional replication only at midnight? Better off doing it
> continually throughout the day.

The thing is snapshot taking a lot of time to do it. Even at night we
had a problem with customers.

> And btw, 2000 transactions, unless they're huge, is trivial. I have systems
> doing that per minute.
> The other option is to look into log shipping.
> There are scripts out there that let you do it even w/o Enterprise edition,
> though it is then admittedly more manual.

As you said it is manual we can not afford manual solutions.

Thanks

>
> > I need an advice how I can create a replication or is there any other
> > way to replicate or is there any way to do this process without
> > bothering the system? Please give me some advice and help..
> > Thanks
> > asa.|||"laststubborn" <arafatsalih@.gmail.com> wrote in message
news:1147185632.084129.202140@.j73g2000cwa.googlegr oups.com...
> Greg D. Moore (Strider) wrote:
> > "laststubborn" <arafatsalih@.gmail.com> wrote in message
> > news:1147164897.180455.80350@.j33g2000cwa.googlegro ups.com...
> > > Dear All,
> > > > We have a big concern in our Database system. We have 2000
transactions
> > > daily in our database. We need to replicate some how the database for
> > > our fail over setup. I tried transactional replication at midnight but
> > > our all systems locked and we had a lot of complaints from the
> > > customers and It was taking a lot of time to snapshot part and I had
to
> > > abort it because of these reasons.
> > Why do the transactional replication only at midnight? Better off doing
it
> > continually throughout the day.
> The thing is snapshot taking a lot of time to do it. Even at night we
> had a problem with customers.

I'm not following, or we're not communicating effectively. A transactional
backup should not be taking that long or have that much impact. How large
are these transactions? Like I say, I have a system doing that many a
minute (though that one we don't backup). The one we do transactional
backups on every 20 minutes probably does 2000/hour or more at peak time.
(plus a very high number of pure select only queries.)

> > And btw, 2000 transactions, unless they're huge, is trivial. I have
systems
> > doing that per minute.
> > The other option is to look into log shipping.
> > There are scripts out there that let you do it even w/o Enterprise
edition,
> > though it is then admittedly more manual.
> As you said it is manual we can not afford manual solutions.

Well, what do you consider too manual. In the case of many of these scripts
the failover itself may or may not be automatic, but can generally be
scripted. The log-shipping itself is scripted.

In our case, we do log backups from our main server every 20 minutes and
restore them to our backup server every 20 minutes, but with either a 4 hour
or 6 hour delay (I forget which). To bring the backup system "up to date" I
can do in about 15 minutes.. either manually or via running a quick script.

The bigger delay (whcih we'd have using Enterprise Server also) is updating
our front end DSNs. And we have that scripted also.

All in all, a failover would probably take us 15 minutes or less to recover
from.
> Thanks
> > > I need an advice how I can create a replication or is there any other
> > > way to replicate or is there any way to do this process without
> > > bothering the system? Please give me some advice and help..
> > > > Thanks
> > > asa.
>|||yep I think we had a communication problem. I was asking about the
replication not for a backup (I dont know whether you mean replication
when you use 'transactional backup') Back Up is not a problem as you
said we dont have problem on that however I will create failover
cluster but I will replicate the database first. That is my problem
transactional replication.. That is why I asked all these questions.

Thank you|||"laststubborn" <arafatsalih@.gmail.com> wrote in message
news:1147244663.232015.249020@.u72g2000cwu.googlegr oups.com...
> yep I think we had a communication problem. I was asking about the
> replication not for a backup (I dont know whether you mean replication
> when you use 'transactional backup') Back Up is not a problem as you
> said we dont have problem on that however I will create failover
> cluster but I will replicate the database first. That is my problem
> transactional replication.. That is why I asked all these questions.

Again, I'm still not sure what you mean here.

In my original post I asked why you weren't simply doing the transactional
replication throughout the day.

Then you brought up snap-shotting. This isn't a term usually used with
transactional replication.

A transactional replication setup really shouldn't lock your system, so I'm
missing something here.

> Thank you|||Greg D. Moore (Strider) (mooregr_deleteth1s@.greenms.com) writes:
> Then you brought up snap-shotting. This isn't a term usually used with
> transactional replication.

Not that replication is my best game, but doesn't a transactional
replication scheme usually start with the replication of a snapshot?

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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns97BFF41144A46Yazorman@.127.0.0.1...
> Greg D. Moore (Strider) (mooregr_deleteth1s@.greenms.com) writes:
> > Then you brought up snap-shotting. This isn't a term usually used with
> > transactional replication.
> Not that replication is my best game, but doesn't a transactional
> replication scheme usually start with the replication of a snapshot?

Yes, but it's a one time game. And there are ways around that (not
necessarily clean ones unfortunately).

>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thats the thing, I could not pass one time snapshot part. During the
initial snapshot I had problems, Our application was locked and It was
taking so long we had to cancel it. You said that there are ways around
that how ? If you give me some help on that I really appreciate it.

Also any of you did a failover clustering? I will do this first time
and I have some questions.

Thanks|||"laststubborn" <arafatsalih@.gmail.com> wrote in message
news:1147348989.967368.134060@.j73g2000cwa.googlegr oups.com...
> Thats the thing, I could not pass one time snapshot part. During the
> initial snapshot I had problems, Our application was locked and It was
> taking so long we had to cancel it. You said that there are ways around
> that how ? If you give me some help on that I really appreciate it.

Ah, now I better understand what you're talking about.

I'm a bit surpised with only 2000 transactions a day you can't fnid a quiet
time (perhaps on a weekend?) to make the snapshot.

Anyway, there's KB articles on MS on various ways of doing this (and I
believe SQL 2005 has options also that help.)

Anyway, if you CAN pause work for a shrot period of time, try something like
the following:

Do a full backup of DB on "Publisher".
Do a full restore WITH NORECOVERY on "subscriber"
Since this will take some time, you'll need to do the following (and up
until now you users could still use the system.)

Stop all access to the system
Do a transaction log backup from the "publisher"
Restore to the "subscriber", this time with RECOVERY

Setup replication, but say, "subscriber has data and schema"

Permit access to the system.

This is not guaranteed to solve your problem, but I've done it with success
before.

There's several catches to watch out for:

1) if you know your initial transaction log backup will take a long time, do
it w/o kicking folks out of the publisher and restore with NORECOVERY and
then do the transaction log backup a 2nd time (or 3rd, etc.) Trick is to
get that last transaction log backup/restore cycle as absolutely as short as
possible.

Setup as much of replication in advance as possible, i.e. setup the
publisher/distributer side of things before hand.

Script out as much as you can.

Finally.. be careful of IDENTITY columns. This is where things can break.

Note to, if you decide you need to make schema changes on the subscriber, do
this after replication is setup.

The above is not guaranteed to solve your problem but I've used it in
similar cases with success.

> Also any of you did a failover clustering? I will do this first time
> and I have some questions.
> Thanks

need design advice

we are desgning a db that will keep name and address information for all
kinds of entities: customers, employees, vendors, contacts, etc. Instead of
having N/A fields in each of the tables it seems like a good idea to have
one nameaddess table keyed by an identity int and have all of the other
tables reference this table via foreign key (either implicit or explicit).
What are the pros and cons of doing this kind of design?
Thanks,
T
Not sure what your referencing by an "N/A" field. However, if I'm
following you correctly, setting this up will depend if address can
have more than one entity (ie: one address can be a vendor and a
customer or something like that).
If not, then 2 tables should do it:
tbl_addresses
tbl_entities
the entities table will have "customers", "employees" etc. marked with
a PK (ie: "entity_id"). Then, of course, you'd have an "entity_id"
column in the addresses table that's a FK.
If an address can have more than one entity, then you can add a third
table that has three columns: the PK for the third table and 2 FK's
(one for addresses and one for entities). Here you wouldn't need the
FK in the "adresses" table.
So, let's say address #8 in the table has 1 entity and address #9 has
3, your 3rd table's data would something like:
ID ADDRESS_ID ENTITY_ID
1 8 2
2 9 2
3 9 4
4 9 5
and so on...
Of course, the "entity_id" shown above would refer to customers or
employees or whatever.
Hope that makes sense or helps in some way!
Jeremy

need design advice

we are desgning a db that will keep name and address information for all
kinds of entities: customers, employees, vendors, contacts, etc. Instead of
having N/A fields in each of the tables it seems like a good idea to have
one nameaddess table keyed by an identity int and have all of the other
tables reference this table via foreign key (either implicit or explicit).
What are the pros and cons of doing this kind of design?
Thanks,
TNot sure what your referencing by an "N/A" field. However, if I'm
following you correctly, setting this up will depend if address can
have more than one entity (ie: one address can be a vendor and a
customer or something like that).
If not, then 2 tables should do it:
tbl_addresses
tbl_entities
the entities table will have "customers", "employees" etc. marked with
a PK (ie: "entity_id"). Then, of course, you'd have an "entity_id"
column in the addresses table that's a FK.
If an address can have more than one entity, then you can add a third
table that has three columns: the PK for the third table and 2 FK's
(one for addresses and one for entities). Here you wouldn't need the
FK in the "adresses" table.
So, let's say address #8 in the table has 1 entity and address #9 has
3, your 3rd table's data would something like:
ID ADDRESS_ID ENTITY_ID
----
1 8 2
2 9 2
3 9 4
4 9 5
and so on...
Of course, the "entity_id" shown above would refer to customers or
employees or whatever.
Hope that makes sense or helps in some way!
Jeremysql

need design advice

we are desgning a db that will keep name and address information for all
kinds of entities: customers, employees, vendors, contacts, etc. Instead of
having N/A fields in each of the tables it seems like a good idea to have
one nameaddess table keyed by an identity int and have all of the other
tables reference this table via foreign key (either implicit or explicit).
What are the pros and cons of doing this kind of design?
Thanks,
TNot sure what your referencing by an "N/A" field. However, if I'm
following you correctly, setting this up will depend if address can
have more than one entity (ie: one address can be a vendor and a
customer or something like that).
If not, then 2 tables should do it:
tbl_addresses
tbl_entities
the entities table will have "customers", "employees" etc. marked with
a PK (ie: "entity_id"). Then, of course, you'd have an "entity_id"
column in the addresses table that's a FK.
If an address can have more than one entity, then you can add a third
table that has three columns: the PK for the third table and 2 FK's
(one for addresses and one for entities). Here you wouldn't need the
FK in the "adresses" table.
So, let's say address #8 in the table has 1 entity and address #9 has
3, your 3rd table's data would something like:
ID ADDRESS_ID ENTITY_ID
----
1 8 2
2 9 2
3 9 4
4 9 5
and so on...
Of course, the "entity_id" shown above would refer to customers or
employees or whatever.
Hope that makes sense or helps in some way!
Jeremy

Monday, March 19, 2012

Need an Expert Advice

I am using VS 2003 and trying to add a web reference reportservices2005.asmx on windows 2003 server.

I am able to do the same thing in win XP machines and works perfectly fine. now facing the problem with windows 2003 server.

i need to run or render the reports(RS2005 version) from VS 2003.

Pleeeeeease help.

Not sure why you're encountering this problem on W2K3. You can create your solution on the XP machine and then just copy it over to the 2K3 box.

Hope that helps,

-Lukasz

|||

Thks Lukasz.

I found some info on that, on windows 2003 server it uses IIS6.0, iis 6.0 has it own processing mode it does not use aspnet_wp.exe process when you run or render a report.

it ggives an error saying you cannot run two versions in one single process mode.

for it we need to change the process mode to run www using iis 5.0 isolation mode. that way we can run multiple versions of .net in one process mode. thats what happens on xp based machines.

|||

Oh, that's an entirely different problem. You cannot run two version of .Net Framework in the same process space. In W2K3, you can create a new application pool for the report server service and then assign it to the report server virtual directory. You can do this in the Reporting Services configuration tool. When you use this tool, the application pool will be setup they way you need it for RS.

Let me know if that doesn't solve the problem.

-Lukasz

|||

Lukasz, i noticed a problem with that, it is not even allowing me to add a webreference from my VS 2003 project to add a reportingservice2005.asmx

this problem is only happening on windows 2003 server and it gives me the above message and logs an error under events (application log)

if i am creating or trying to add a webreference on a win xp machine, it does'nt create that problem for me.

only on w2003 server this is happening. what options do i have fro vs 2003 calling a webservice render method reportexecution2005.asmx or reportingservice2005.asmx

Thanks Lukasz.

Need an Expert Advice

I am using VS 2003 and trying to add a web reference reportservices2005.asmx on windows 2003 server.

I am able to do the same thing in win XP machines and works perfectly fine. now facing the problem with windows 2003 server.

i need to run or render the reports(RS2005 version) from VS 2003.

Pleeeeeease help.

Not sure why you're encountering this problem on W2K3. You can create your solution on the XP machine and then just copy it over to the 2K3 box.

Hope that helps,

-Lukasz

|||

Thks Lukasz.

I found some info on that, on windows 2003 server it uses IIS6.0, iis 6.0 has it own processing mode it does not use aspnet_wp.exe process when you run or render a report.

it ggives an error saying you cannot run two versions in one single process mode.

for it we need to change the process mode to run www using iis 5.0 isolation mode. that way we can run multiple versions of .net in one process mode. thats what happens on xp based machines.

|||

Oh, that's an entirely different problem. You cannot run two version of .Net Framework in the same process space. In W2K3, you can create a new application pool for the report server service and then assign it to the report server virtual directory. You can do this in the Reporting Services configuration tool. When you use this tool, the application pool will be setup they way you need it for RS.

Let me know if that doesn't solve the problem.

-Lukasz

|||

Lukasz, i noticed a problem with that, it is not even allowing me to add a webreference from my VS 2003 project to add a reportingservice2005.asmx

this problem is only happening on windows 2003 server and it gives me the above message and logs an error under events (application log)

if i am creating or trying to add a webreference on a win xp machine, it does'nt create that problem for me.

only on w2003 server this is happening. what options do i have fro vs 2003 calling a webservice render method reportexecution2005.asmx or reportingservice2005.asmx

Thanks Lukasz.

Need an expert advice

Hi,
we have a legacy database on a UNIX box for our production system (OLTP).
This is the only database used for both OLTP and custom reporting. The
database is now hugh and reporting is very limited as well as slow
processing. When certain reports are run the users have latency in inputing
data.
I am thinking of importing some of the tables nightly to SQL Server and
then creating come cubes for reports. The issues I have are:
1. All of the tables in the UNIX box doesn't have timestamp so there is no
way of improting changed data and it database doesn't support replication so
I'll have to import the entire table(s) nightly. Would this affect my cubes?
2. Would it be better to import the data to a separate server (staging) and
then import the data from the second server to a third serer running MSAS?
3. One of the table is an Archive table where all settled sales are
transferred to, however, due to the nature of our business and the current
system design, some users go back and edit previous data so if i run a report
now (for let's say sept last year) I see sales as 2.00 dollars and later
today I see sales as 2.50. There is no way of knowing which row was changed.
So if I import the data to create a cube can I then snapshot that cube since
I'll be importing the antire "Archive" table nightly. I know it sounds
screwed up but it's what I have to work with. Or how can I solve this.
Thanks
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:12FD68B7-BD47-4C86-BA66-99BE1EDF9473@.microsoft.com...
> Hi,
> we have a legacy database on a UNIX box for our production system (OLTP).
> This is the only database used for both OLTP and custom reporting. The
> database is now hugh and reporting is very limited as well as slow
> processing. When certain reports are run the users have latency in
> inputing
> data.
>
Even with the reporting load moved to a different server, if the OLTP server
continues to accumulate massive amounts of transactions, the duration of
simple primary key lookups will eventually not meet the user's performance
expectations. In addition to replicating data for reporting purposes, you
may want to have a daily or monthly process that archives unneeded
historical transactions from the OLTP system to an Operational Data Store
(ODS) database (not necessarily a seperate server). If needed, you can still
give the operational applications query access to this data by implementing
partitioned views.
http://www.dmreview.com/article_sub.cfm?articleId=469
http://msdn.microsoft.com/library/de...es_06_17zr.asp

> I am thinking of importing some of the tables nightly to SQL Server and
> then creating come cubes for reports. The issues I have are:
> 1. All of the tables in the UNIX box doesn't have timestamp so there is no
> way of improting changed data and it database doesn't support replication
> so
> I'll have to import the entire table(s) nightly. Would this affect my
> cubes?
>
With no timestamp of any kind, then standard replication is not an option.
You can add a trigger to log insert / update / deletes on the OLTP system to
seperate tables (perhaps only storing IDs of rows that were modified), and
implement a DTS package that copies over the needed data based on this
information from this log.
http://www.microsoft.com/technet/pro.../c07ppcsq.mspx
http://msdn.microsoft.com/library/de...tbpwithdts.asp

> 2. Would it be better to import the data to a separate server (staging)
> and
> then import the data from the second server to a third serer running MSAS?
>
See the above reccomendation for an ODS database. For performance reasons,
it would be best to have this on a dedicated server, but it could be located
on the OLTP or MSAS server.

> 3. One of the table is an Archive table where all settled sales are
> transferred to, however, due to the nature of our business and the current
> system design, some users go back and edit previous data so if i run a
> report
> now (for let's say sept last year) I see sales as 2.00 dollars and later
> today I see sales as 2.50. There is no way of knowing which row was
> changed.
That's another reason for the logging trigger mentioned above; it also
audits changes on these OLTP tables. Also, useful in the log tables would be
a datetime column to keep track of when the changes took place.
http://msdn.microsoft.com/msdnmag/is...04/DataPoints/

> So if I import the data to create a cube can I then snapshot that cube
> since
> I'll be importing the antire "Archive" table nightly. I know it sounds
> screwed up but it's what I have to work with. Or how can I solve this.
The audit log tables on the OLTP system can keep a history of data
modifications to settled sales, and I assume this event would be occasional
and not too frequent. Also, the MSAS cubes can be archived (just like SQL
Server databases), things like Excel pivot tables can be archived, and
reports can be printed as archivable PDF documents.
http://www.microsoft.com/technet/pro.../anservog.mspx

> Thanks
|||what is the number of rows in the OLTP database?
what is your RDBMS on this server?
servers like Oracle can create a simple flatfile which contains all the
transaction made against a table;
there is no timestamp, but can you create triggers in your database?
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:12FD68B7-BD47-4C86-BA66-99BE1EDF9473@.microsoft.com...
> Hi,
> we have a legacy database on a UNIX box for our production system (OLTP).
> This is the only database used for both OLTP and custom reporting. The
> database is now hugh and reporting is very limited as well as slow
> processing. When certain reports are run the users have latency in
> inputing
> data.
> I am thinking of importing some of the tables nightly to SQL Server and
> then creating come cubes for reports. The issues I have are:
> 1. All of the tables in the UNIX box doesn't have timestamp so there is no
> way of improting changed data and it database doesn't support replication
> so
> I'll have to import the entire table(s) nightly. Would this affect my
> cubes?
> 2. Would it be better to import the data to a separate server (staging)
> and
> then import the data from the second server to a third serer running MSAS?
> 3. One of the table is an Archive table where all settled sales are
> transferred to, however, due to the nature of our business and the current
> system design, some users go back and edit previous data so if i run a
> report
> now (for let's say sept last year) I see sales as 2.00 dollars and later
> today I see sales as 2.50. There is no way of knowing which row was
> changed.
> So if I import the data to create a cube can I then snapshot that cube
> since
> I'll be importing the antire "Archive" table nightly. I know it sounds
> screwed up but it's what I have to work with. Or how can I solve this.
> Thanks
|||Hi ?
(for some reason the first post is not here)

> Hi,
> we have a legacy database on a UNIX box for our production system (OLTP).
> This is the only database used for both OLTP and custom reporting. The
> database is now hugh and reporting is very limited as well as slow
> processing. When certain reports are run the users have latency in
> inputing
> data.
Well, situation normal....starting point is to look at the business
from a business perspective and determine if there is value in going
the data warehouse route or if all that is warranted from a
profitability point of view is operational reporting on another
database image.
In most businesses today a data warehouse is well justified based on
profit contribution.
If you go the DW route you will need to get to incremental
extracts...if the operational system does not have the ability to
provide them (due to appaulingly limited design in this day and age)
then you must generate them. My company provides free tools to do this.
Then you are on the road to doing 'Business Intelligence' and there is
quite a learning curve. You can choose to 'go it alone' or hire in a
partner to assist. Of course, as a long term BI consultant I would
land on the side of hiring someone but many companies 'buy the books
and go it alone'... ;-)
I sincerely doubt the most profitable approach is getting one answer at
a time from a forum.
Please see my beginners page for the best books on the
subject...www.peternolan.com
Best Regards
Peter

Need an expert advice

Hi,
we have a legacy database on a UNIX box for our production system (OLTP).
This is the only database used for both OLTP and custom reporting. The
database is now hugh and reporting is very limited as well as slow
processing. When certain reports are run the users have latency in inputing
data.
I am thinking of importing some of the tables nightly to SQL Server and
then creating come cubes for reports. The issues I have are:
1. All of the tables in the UNIX box doesn't have timestamp so there is no
way of improting changed data and it database doesn't support replication so
I'll have to import the entire table(s) nightly. Would this affect my cubes?
2. Would it be better to import the data to a separate server (staging) and
then import the data from the second server to a third serer running MSAS?
3. One of the table is an Archive table where all settled sales are
transferred to, however, due to the nature of our business and the current
system design, some users go back and edit previous data so if i run a repor
t
now (for let's say sept last year) I see sales as 2.00 dollars and later
today I see sales as 2.50. There is no way of knowing which row was changed.
So if I import the data to create a cube can I then snapshot that cube since
I'll be importing the antire "Archive" table nightly. I know it sounds
screwed up but it's what I have to work with. Or how can I solve this.
Thanks"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:12FD68B7-BD47-4C86-BA66-99BE1EDF9473@.microsoft.com...
> Hi,
> we have a legacy database on a UNIX box for our production system (OLTP).
> This is the only database used for both OLTP and custom reporting. The
> database is now hugh and reporting is very limited as well as slow
> processing. When certain reports are run the users have latency in
> inputing
> data.
>
Even with the reporting load moved to a different server, if the OLTP server
continues to accumulate massive amounts of transactions, the duration of
simple primary key lookups will eventually not meet the user's performance
expectations. In addition to replicating data for reporting purposes, you
may want to have a daily or monthly process that archives unneeded
historical transactions from the OLTP system to an Operational Data Store
(ODS) database (not necessarily a seperate server). If needed, you can still
give the operational applications query access to this data by implementing
partitioned views.
http://www.dmreview.com/article_sub.cfm?articleId=469
http://msdn.microsoft.com/library/d...>
_06_17zr.asp

> I am thinking of importing some of the tables nightly to SQL Server and
> then creating come cubes for reports. The issues I have are:
> 1. All of the tables in the UNIX box doesn't have timestamp so there is no
> way of improting changed data and it database doesn't support replication
> so
> I'll have to import the entire table(s) nightly. Would this affect my
> cubes?
>
With no timestamp of any kind, then standard replication is not an option.
You can add a trigger to log insert / update / deletes on the OLTP system to
seperate tables (perhaps only storing IDs of rows that were modified), and
implement a DTS package that copies over the needed data based on this
information from this log.
http://www.microsoft.com/technet/pr...s/c07ppcsq.mspx
http://msdn.microsoft.com/library/d...ntbpwithdts.asp

> 2. Would it be better to import the data to a separate server (staging)
> and
> then import the data from the second server to a third serer running MSAS?
>
See the above reccomendation for an ODS database. For performance reasons,
it would be best to have this on a dedicated server, but it could be located
on the OLTP or MSAS server.

> 3. One of the table is an Archive table where all settled sales are
> transferred to, however, due to the nature of our business and the current
> system design, some users go back and edit previous data so if i run a
> report
> now (for let's say sept last year) I see sales as 2.00 dollars and later
> today I see sales as 2.50. There is no way of knowing which row was
> changed.
That's another reason for the logging trigger mentioned above; it also
audits changes on these OLTP tables. Also, useful in the log tables would be
a datetime column to keep track of when the changes took place.
http://msdn.microsoft.com/msdnmag/i.../04/DataPoints/

> So if I import the data to create a cube can I then snapshot that cube
> since
> I'll be importing the antire "Archive" table nightly. I know it sounds
> screwed up but it's what I have to work with. Or how can I solve this.
The audit log tables on the OLTP system can keep a history of data
modifications to settled sales, and I assume this event would be occasional
and not too frequent. Also, the MSAS cubes can be archived (just like SQL
Server databases), things like Excel pivot tables can be archived, and
reports can be printed as archivable PDF documents.
http://www.microsoft.com/technet/pr...n/anservog.mspx

> Thanks|||what is the number of rows in the OLTP database?
what is your RDBMS on this server?
servers like Oracle can create a simple flatfile which contains all the
transaction made against a table;
there is no timestamp, but can you create triggers in your database?
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:12FD68B7-BD47-4C86-BA66-99BE1EDF9473@.microsoft.com...
> Hi,
> we have a legacy database on a UNIX box for our production system (OLTP).
> This is the only database used for both OLTP and custom reporting. The
> database is now hugh and reporting is very limited as well as slow
> processing. When certain reports are run the users have latency in
> inputing
> data.
> I am thinking of importing some of the tables nightly to SQL Server and
> then creating come cubes for reports. The issues I have are:
> 1. All of the tables in the UNIX box doesn't have timestamp so there is no
> way of improting changed data and it database doesn't support replication
> so
> I'll have to import the entire table(s) nightly. Would this affect my
> cubes?
> 2. Would it be better to import the data to a separate server (staging)
> and
> then import the data from the second server to a third serer running MSAS?
> 3. One of the table is an Archive table where all settled sales are
> transferred to, however, due to the nature of our business and the current
> system design, some users go back and edit previous data so if i run a
> report
> now (for let's say sept last year) I see sales as 2.00 dollars and later
> today I see sales as 2.50. There is no way of knowing which row was
> changed.
> So if I import the data to create a cube can I then snapshot that cube
> since
> I'll be importing the antire "Archive" table nightly. I know it sounds
> screwed up but it's what I have to work with. Or how can I solve this.
> Thanks|||Hi ?
(for some reason the first post is not here)

> Hi,
> we have a legacy database on a UNIX box for our production system (OLTP).
> This is the only database used for both OLTP and custom reporting. The
> database is now hugh and reporting is very limited as well as slow
> processing. When certain reports are run the users have latency in
> inputing
> data.
Well, situation normal....starting point is to look at the business
from a business perspective and determine if there is value in going
the data warehouse route or if all that is warranted from a
profitability point of view is operational reporting on another
database image.
In most businesses today a data warehouse is well justified based on
profit contribution.
If you go the DW route you will need to get to incremental
extracts...if the operational system does not have the ability to
provide them (due to appaulingly limited design in this day and age)
then you must generate them. My company provides free tools to do this.
Then you are on the road to doing 'Business Intelligence' and there is
quite a learning curve. You can choose to 'go it alone' or hire in a
partner to assist. Of course, as a long term BI consultant I would
land on the side of hiring someone but many companies 'buy the books
and go it alone'... ;-)
I sincerely doubt the most profitable approach is getting one answer at
a time from a forum.
Please see my beginners page for the best books on the
subject...www.peternolan.com
Best Regards
Peter

Need Advise on SQL Express with Advanced Services

Hi Guys,

Need some advice on the free SQL Express with Advanced Services provided.

I plan to develop a small departmental multi-user applications with 5 to 6 simultaneous users using the free SQL Express with Advanced Services with VB.net and stored procedures on a local area network.

Is it a good choice to use this free SQL Express with Advanced Services or is it more advisable to purchase a standard version ?

Appreciate if someone could help me to address this issue?

One more thing, can i install the free SQL Express with Advanced Services on a normal desktop with Windows XP SP 2 and utilize it as a server or do i need a proper server with Windows 2003?

Thanks and Regards,

Jansen

If you have a small app and you're sure you'll only have 5 or 6 people generating a small load, then you should be OK with the Express version. I'd still recommend that it go on a server OS, primarilly because of the way security and networking are handled.

You also have some other limitations on Express such as database size and so forth, but you certainly could start your app there and grow into a larger server. All you have to do is backup and restore the database to the Standard Edition, and change your connection strings in your app.

Buck

|||

You should be fine with that, but you need to consider the space limitations as well. You can always grow the app into a Standard Edition. I'd also recommend that you always use a Server OS.

Buck

Monday, March 12, 2012

Need Advise on SQL Express with Advanced Services

Hi Guys,

Need some advice on the free SQL Express with Advanced Services provided.

I plan to develop a small departmental multi-user applications with 5 to 6 simultaneous users using the free SQL Express with Advanced Services with VB.net and stored procedures on a local area network.

Is it a good choice to use this free SQL Express with Advanced Services or is it more advisable to purchase a standard version ?

Appreciate if someone could help me to address this issue?

One more thing, can i install the free SQL Express with Advanced Services on a normal desktop with Windows XP SP 2 and utilize it as a server or do i need a proper server with Windows 2003.

Thanks and Regards,

Jansen

Express is well suited to the task you are discussing and yes it should install on a std windows desktop.

Need Advice/Help on querying a different db

I have 2 different database's on the same server. I'm trying to create a stored proc that resides in Reporting database but queries against the Call database. 4 part naming convention gives me an error of 'invalid object name' What am I forgetting here?My first guess would be that you forgot how to spell the object name. The next guess would be that you are doing something that doesn't make sense, like SELECT * FROM myStoredProcedure or the equivalent.

-PatP|||stored procedure lies in ABC4_Dev1_Reporting
Data resides in ABC_Dev1_Call1

From Reporting db in query analyzer I cannot get the following query to run

select * from dbo.ABC_Dev1_Call1.Call (Call is the table)

What am I missing?
Thanks in advance!|||Ah, a snippet of code is worth a thousand words of description! I'd use:SELECT *
FROM ABC_Dev1_Call1.dbo.Call-PatP|||Ah... very interesting... I'm claiming a bad case of the friday's on that one. I owe you one. Thanks a million. Have a good weekend.|||Listen...if Pat collected them all...he'd be hammered all year...

You threw me with the 4 part naming convention....

See what happens when I take a break and get a sandwich...

Need advice. Dropdown tables and moving data

Hi,
I have the following problem. In my system, I'm going to have many
tables that use drop-down tables. For example, my 'Persons' table has a
column called 'FK_HairColors_ID' which is a FK of the table 'HairColors'
If I want to add a new person calld 'John' with black hair, I do this:
insert into haircolors (id,color) values (1,'brown')
insert into haircolors (id,color) values (2,'black')
insert into persons (siteid,id,name,fk_haircolors_id) values ('site 1'
1,'john',2)
I also though that instead of doing this, I could insert the value
directly there. Something like this:
insert into haircolors (pk) values ('brown')
insert into haircolors (pk) values ('black')
insert into persons (siteid,id,name,fk_haircolors_pk) values ('site
1',1,'john','brown')
And I would add a relation between those tables, so the the system would
check that the values that I have for the hair color in Persons are in
the HairColors table.
Obviously, the first solution is more elegant. But maybe for my problem
it will be better the second solution.
Here is my problem.
I am going to have multiple sites running this type of db. We are going
to have some processes that will transfer records from one site to
another. That's why we have that 'siteid' field there for Persons. My
question is:
Should I have siteid for the haircolors as well? (I mean to add a column
'SiteID' in the HairColors table) Does that make sense? In that case we
could have 2 'black' hair color records that came from different sites.
If not, everytime that I move a Person from one site to another, I would
have to 'reconvert' the id of the Haircolor to the one matching in the
new site. For example, if for 'site 1' the black hair color had ID=2,
and for 'site 2' has ID=200, and I moving a record from 1 to 2, I would
have to convert that ID from 2 to 200.
What do you guys think?
Thanks for reading everything. I know it's a little bit confusing, but I
hope you guys got the idea of my problem.
RegardsStar wrote:
> Hi,
> I have the following problem. In my system, I'm going to have many
> tables that use drop-down tables. For example, my 'Persons' table has a
> column called 'FK_HairColors_ID' which is a FK of the table 'HairColors'
> If I want to add a new person calld 'John' with black hair, I do this:
> insert into haircolors (id,color) values (1,'brown')
> insert into haircolors (id,color) values (2,'black')
> insert into persons (siteid,id,name,fk_haircolors_id) values ('site 1'
> 1,'john',2)
> I also though that instead of doing this, I could insert the value
> directly there. Something like this:
> insert into haircolors (pk) values ('brown')
> insert into haircolors (pk) values ('black')
> insert into persons (siteid,id,name,fk_haircolors_pk) values ('site
> 1',1,'john','brown')
> And I would add a relation between those tables, so the the system would
> check that the values that I have for the hair color in Persons are in
> the HairColors table.
> Obviously, the first solution is more elegant. But maybe for my problem
> it will be better the second solution.
> Here is my problem.
> I am going to have multiple sites running this type of db. We are going
> to have some processes that will transfer records from one site to
> another. That's why we have that 'siteid' field there for Persons. My
> question is:
> Should I have siteid for the haircolors as well? (I mean to add a column
> 'SiteID' in the HairColors table) Does that make sense? In that case we
> could have 2 'black' hair color records that came from different sites.
> If not, everytime that I move a Person from one site to another, I would
> have to 'reconvert' the id of the Haircolor to the one matching in the
> new site. For example, if for 'site 1' the black hair color had ID=2,
> and for 'site 2' has ID=200, and I moving a record from 1 to 2, I would
> have to convert that ID from 2 to 200.
> What do you guys think?
> Thanks for reading everything. I know it's a little bit confusing, but I
> hope you guys got the idea of my problem.
> Regards
"Dropdown tables"! (shudder) Do you really believe that the job of
tables is to model a user-interface for you?
Neither of your proposed solutions solves the problem you are getting
at. That is: "How do I ensure that all my sites encode hair colours in
the same way?" For example, does "Blond"="Blonde"? Does "Brown" mean
the same as "Brunette"? If you leave decisions like that to end users
then you will have a big task on your hands when you come to integrate
your data. If you have a standard set of codes that is centrally
maintained then you won't have that problem whatever method you use
(but do please choose a recognized standard coding convention if one
exists for your data).
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||David,
We cannot have a centralized site that can provide nice codes to each
one. Some sites will be working as an standalone sites without access
outside their network. We don't know if in the future they may be
interested in sharing some data. If they are later, they will provide
access to the remote sites temporarily, while the transfer is being made.
On the other hand, users want to be able to add new values to those
'dropdown tables' at any time.
In the hypothetical case that we could have a centralized site, some
sites wouldn't be interested in seeing the 'set of codes' from the
other 40 sites, when they have to select a value. Had you thought about
that?. Some 'drop-down tables' are not as simple as 'Hair Colors'... For
example, some may be 'Arrest codes' for a specific police department. We
don't want to have site 1 to see the arrest codes from each one of the
sites!! (shudder)
For that reason, and before shuddering and criticizing take a look at
the real world with real customers. It's great to answer the newsgroups
with 3 o 4 things that you got from the books that you have read, but in
the real world things are not so 'standard' and cannot be made in the
most elegant way.
David Portas wrote:
> Star wrote:
>
>
> "Dropdown tables"! (shudder) Do you really believe that the job of
> tables is to model a user-interface for you?
> Neither of your proposed solutions solves the problem you are getting
> at. That is: "How do I ensure that all my sites encode hair colours in
> the same way?" For example, does "Blond"="Blonde"? Does "Brown" mean
> the same as "Brunette"? If you leave decisions like that to end users
> then you will have a big task on your hands when you come to integrate
> your data. If you have a standard set of codes that is centrally
> maintained then you won't have that problem whatever method you use
> (but do please choose a recognized standard coding convention if one
> exists for your data).
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>|||For your hair color example I would forget using an artificial key
(HairColorID) and just use 'brown' or 'black' as the value. I do not
find using a number to be "elegent", though it is sometimes necessary.
For something more complicated, as you described in your second
message, I would be inclined to make the key two part, site and
ArrestCode. But I would have to see what sort of data went into an
ArrestCode master table before choosing the key.
Also, if you provide a simple example that is not representative of
the real problem, don't get too critical of the answers that reflect
your question as asked instead of the real problem. I also do not
know why you would assume that any particular advice is based on
examples in books. Believe it or not a lot of answers here are based
on years of hard won experience. For myself, just about any approach
I suggest avoiding is because I am trying to help others avoid my own
past mistakes. 8-)
Roy Harvey
Beacon Falls, CT
On Tue, 28 Mar 2006 22:46:58 +0200, Star <star@.nospam.com> wrote:

>Hi,
>I have the following problem. In my system, I'm going to have many
>tables that use drop-down tables. For example, my 'Persons' table has a
>column called 'FK_HairColors_ID' which is a FK of the table 'HairColors'
>If I want to add a new person calld 'John' with black hair, I do this:
>insert into haircolors (id,color) values (1,'brown')
>insert into haircolors (id,color) values (2,'black')
>insert into persons (siteid,id,name,fk_haircolors_id) values ('site 1'
>1,'john',2)
>I also though that instead of doing this, I could insert the value
>directly there. Something like this:
>insert into haircolors (pk) values ('brown')
>insert into haircolors (pk) values ('black')
>insert into persons (siteid,id,name,fk_haircolors_pk) values ('site
>1',1,'john','brown')
>And I would add a relation between those tables, so the the system would
>check that the values that I have for the hair color in Persons are in
>the HairColors table.
>Obviously, the first solution is more elegant. But maybe for my problem
>it will be better the second solution.
>Here is my problem.
>I am going to have multiple sites running this type of db. We are going
>to have some processes that will transfer records from one site to
>another. That's why we have that 'siteid' field there for Persons. My
>question is:
>Should I have siteid for the haircolors as well? (I mean to add a column
>'SiteID' in the HairColors table) Does that make sense? In that case we
>could have 2 'black' hair color records that came from different sites.
>If not, everytime that I move a Person from one site to another, I would
>have to 'reconvert' the id of the Haircolor to the one matching in the
>new site. For example, if for 'site 1' the black hair color had ID=2,
>and for 'site 2' has ID=200, and I moving a record from 1 to 2, I would
>have to convert that ID from 2 to 200.
>What do you guys think?
>Thanks for reading everything. I know it's a little bit confusing, but I
>hope you guys got the idea of my problem.
>Regards|||Thanks for your answer, Roy. I think I will end up using your
first suggestion.
Regarding David's answer... I understand that I could have given more
information about my problem, like I did in my second post, however
there are many ways of helping, and this was not the best way of doing it:

>"Dropdown tables"! (shudder) Do you really believe that the job of
>tables is to model a user-interface for you?
Don't you think? If he needed more information he could have asked
and I would have explained why I needed to have those shuddering
'Dropdown tables'. It's just I didn't think it was necessary to explain
all the reasons I was doing that. I just wanted to mention which one was
my problem.
Thanks again for helping, Roy.
Roy Harvey wrote:
> For your hair color example I would forget using an artificial key
> (HairColorID) and just use 'brown' or 'black' as the value. I do not
> find using a number to be "elegent", though it is sometimes necessary.
> For something more complicated, as you described in your second
> message, I would be inclined to make the key two part, site and
> ArrestCode. But I would have to see what sort of data went into an
> ArrestCode master table before choosing the key.
> Also, if you provide a simple example that is not representative of
> the real problem, don't get too critical of the answers that reflect
> your question as asked instead of the real problem. I also do not
> know why you would assume that any particular advice is based on
> examples in books. Believe it or not a lot of answers here are based
> on years of hard won experience. For myself, just about any approach
> I suggest avoiding is because I am trying to help others avoid my own
> past mistakes. 8-)
> Roy Harvey
> Beacon Falls, CT
>
> On Tue, 28 Mar 2006 22:46:58 +0200, Star <star@.nospam.com> wrote:
>|||Star wrote:
> We cannot have a centralized site that can provide nice codes to each
> one. Some sites will be working as an standalone sites without access
> outside their network. We don't know if in the future they may be
> interested in sharing some data. If they are later, they will provide
> access to the remote sites temporarily, while the transfer is being made.
> On the other hand, users want to be able to add new values to those
> 'dropdown tables' at any time.
In that case you will have integrate and conform the data at some
future date under either of your suggested solutions. I thought you
were asking whether you could avoid that but apparently you cannot.

> In the hypothetical case that we could have a centralized site, some
> sites wouldn't be interested in seeing the 'set of codes' from the
> other 40 sites, when they have to select a value. Had you thought about
> that?. Some 'drop-down tables' are not as simple as 'Hair Colors'... For
> example, some may be 'Arrest codes' for a specific police department. We
> don't want to have site 1 to see the arrest codes from each one of the
> sites!! (shudder)
That's a different question to the one you originally asked. In that
case you would presumably implement another table that mapped Arrect
Codes to Sites so you could track which codes each site could see.

> For that reason, and before shuddering and criticizing take a look at
> the real world with real customers. It's great to answer the newsgroups
> with 3 o 4 things that you got from the books that you have read, but in
> the real world things are not so 'standard' and cannot be made in the
> most elegant way.
I have been working with real customers' for 15 years.
The only criticism I meant to imply in my post was about your use of
the term "dropdown tables". What do you mean by that? Obviously it's
not a standard term. My interpretation was that you called them by that
name because they are used for dropdown lists in your UI. This is not a
good way to look at database design. In fact that mode of thinking
(database follows UI) leads to a lot of mistakes by developers in my
experience. Database design should proceed from business analysis to
conceptual modelling to logical modelling to physical modelling. In
that sense there is only one type of table.
So I'm not saying your solutions are right or wrong because your
example doesn't give us any criteria for that decision. What I was
suggesting was that your use of the term "dropdown table" indicates
that you may not have the right understanding of some database design
concepts.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx|||>Regarding David's answer... I understand that I could have given more
>information about my problem, like I did in my second post, however
>there are many ways of helping, and this was not the best way of doing it:
>
>Don't you think?....
As it happens, I see nothing wrong with Dave's answer. But everyone
sees things their own way.
Roy Harvey
Beacon Falls, CT|||Star skrev:

> Regarding David's answer... I understand that I could have given more
> information about my problem, like I did in my second post, however
> there are many ways of helping, and this was not the best way of doing it:
>
Just to settle this ;)
Star, frankly I think you over-reacted, don't be so sensitive, just
google for CELKO in this newsgroup and be thankful he didn't answer
your question (not yet, anyway).
Anyway, when asking for help on a newsgroup you should prepare yourself
for all sorts of possible answers, remember people are trying to answer
without getting paid or anything, and we all have our ups and downs.
Just keep your own calm, and in the end you probably get some good
answers, for free!
/impslayer, aka Birger Johansson|||impslayer,
yep... I have seen some of Celko's posts. I think he never tries to
help. In my opinion, he usually does the following:
1. Try to ridicule the person asking the question.
2. Recomend the person to buy his 'wonderful' books.
3. If he feels like helping, he will post a solution so theoretical that
will discourage the original poster. He would provide academic exercises
that have little application in the real world.
Regards|||
> The only criticism I meant to imply in my post was about your use of
> the term "dropdown tables". What do you mean by that? Obviously it's
> not a standard term. My interpretation was that you called them by that
> name because they are used for dropdown lists in your UI. This is not a
> good way to look at database design.
David,
Maybe the term 'drop-down tables' was not the best to use. I don't speak
English very well, and I didn't know a better way to say that.
Basically our customers needs to see a drop-down box in the UI with
different values to choose from for some of the fields. That information
needs to be stored in a table, don't you think?. That's why I called
like that. How would you call it?

Need Advice. Blog

Hello,

I am creating a simple blog system using SQL 2005.

I have a Blog table:
[BlogId] > PostId (PK), BlogTitle, ...

And a Posts table
[Posts] > PostId (PK), BlogId (FK), PostContent, PostLabels, ...

PostLabels would have the following format:
Label1,Label2,Label3, etc ...

I will need to perform 3 actions:
1. Get all posts in blog
2. Get all labels in a post
3. Get all unique existing labels in all posts in a blog and make a list.

I am not sure if my approach of using a simple labels column in my Posts table is a good idea.

So my other idea would be to add two more tables:
[BlogLabels] > BlogLabelId (PK), BlogId (FK), LabelName ...

[LabelsInPosts] > BlogLabelId (PK), PostId (PK)

So my idea is:

1. When creating a post one of the parameters would be a comma
separating string with all labels for the post.
Inside SQL Procedure I will need to loop through each label and
check if it exists in BlogLabels. If not then I added it.
For each label I add a records in LabelsInPosts.

How to create this loop? Am I thinking this right?

2. To get a list of all labels in a blog I would need to go to
BlogLabels and get all labels which are related with posts in
LabelsInPosts. Those posts must be only the ones that are related
with my given BlogId.

Grrr, this is getting really confusing for me.
Is this possible to to? How?

Please, give me some advice about all this.

Thanks,
MiguelThe second approach is definitely more scalable and is the standard way to go. You will be able to obtain all the labels with a single select.

Need advice, new to VB 6.0 and SQL server 7

I'm young in programming, i need somebody to tell me the minimum requirement for a software developed in VB 6.0 and SQL server 7
Thanks alotHi there,

a standard Pentium 4 with 256 RAM will do i guess, take care my fren.. :)

Need advice with a query

Hi,
I need an advice.
I have a new project where I have to store employee salary values in order
to keep historical representation of all changes done to the employee
record. Below is the approximate model how I am going to proceed.
My question is, how would I pull ee salary at certain date, say "what was
employee salary on July 1st, 2005".
I know I can do something like that:
SELECT TOP 1 salary FROM tEmployeeSalary
WHERE employee_id = 1
AND DateDiff(dd, 'July 1, 2005', effective_date) >= 0
ORDER BY effective_date ASC
But I would need to use it in joins with other tables. So, is it possible to
write a query to get to the required record without ORDERing and using TOP?
begin tran
create table tEmployeeSalary
(
employee_id int,
salary money,
effective_date datetime,
is_active bit
)
insert into tEmployeeSalary (employee_id, salary, effective_date, is_active)
values (1, 45000, 'dec 12, 2004', 1)
insert into tEmployeeSalary (employee_id, salary, effective_date, is_active)
values (1, 49000, 'mar 1, 2005', 1)
insert into tEmployeeSalary (employee_id, salary, effective_date, is_active)
values (1, 54000, 'june 20, 2005', 1)
insert into tEmployeeSalary (employee_id, salary, effective_date, is_active)
values (1, 67000, 'sep 10, 2005', 1)
select * from tEmployeeSalary
drop table tEmployeeSalary
commit tran
Thank you in advance for all suggestions.
GenaNews,
Assuming salarys are continually increasing and never decrease...maybe this
would work:
SELECT MAX(SALARY)
FROM TEMPLOYEESALARY
WHERE EMPLOYEE_ID = 1 AND EFFECTIVE_DATE <= '7/1/2005'
HTH
Jerry
"News" <zoom191919@.yahoo.com> wrote in message
news:S8Cdna9sLsQCnqHeRVn-iA@.magma.ca...
> Hi,
> I need an advice.
> I have a new project where I have to store employee salary values in order
> to keep historical representation of all changes done to the employee
> record. Below is the approximate model how I am going to proceed.
> My question is, how would I pull ee salary at certain date, say "what was
> employee salary on July 1st, 2005".
> I know I can do something like that:
> SELECT TOP 1 salary FROM tEmployeeSalary
> WHERE employee_id = 1
> AND DateDiff(dd, 'July 1, 2005', effective_date) >= 0
> ORDER BY effective_date ASC
> But I would need to use it in joins with other tables. So, is it possible
> to write a query to get to the required record without ORDERing and using
> TOP?
>
> begin tran
> create table tEmployeeSalary
> (
> employee_id int,
> salary money,
> effective_date datetime,
> is_active bit
> )
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 45000, 'dec 12, 2004', 1)
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 49000, 'mar 1, 2005', 1)
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 54000, 'june 20, 2005', 1)
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 67000, 'sep 10, 2005', 1)
> select * from tEmployeeSalary
> drop table tEmployeeSalary
> commit tran
>
> Thank you in advance for all suggestions.
> Gena
>|||You don't really have every column nullable do you? What are the keys?
Thanks for the DDL and sample data but it would be more helpful if it
was accurate and complete. Assuming that (employee_id, effective_date)
is unique, try this:
SELECT employee_id, salary
FROM tEmployeeSalary AS E
WHERE effective_date =
(SELECT MAX(effective_date)
FROM tEmployeeSalary
WHERE employee_id = E.employee_id
AND effective_date <= '20050701') ;
Be careful with the MONEY datatype. Precision is lost when you multiply
and divide MONEY. In my opinion MONEY is unsuitable for financial data.
(yes, seriously!)
David Portas
SQL Server MVP
--|||You can try to use subquery:
SELECT employee_id, salary
FROM tEmployeeSalary ES1
WHERE ES1.employee_id = 1
AND ES1.effective_date = (SELECT Max(ES2.effective_date )
FROM tEmployeeSalary ES2
WHERE ES2.employee_id =
ES1.employee_id
AND ES2.effective_date <=
'07/01/2004')
Perayu
"News" <zoom191919@.yahoo.com> wrote in message
news:S8Cdna9sLsQCnqHeRVn-iA@.magma.ca...
> Hi,
> I need an advice.
> I have a new project where I have to store employee salary values in order
> to keep historical representation of all changes done to the employee
> record. Below is the approximate model how I am going to proceed.
> My question is, how would I pull ee salary at certain date, say "what was
> employee salary on July 1st, 2005".
> I know I can do something like that:
> SELECT TOP 1 salary FROM tEmployeeSalary
> WHERE employee_id = 1
> AND DateDiff(dd, 'July 1, 2005', effective_date) >= 0
> ORDER BY effective_date ASC
> But I would need to use it in joins with other tables. So, is it possible
> to write a query to get to the required record without ORDERing and using
> TOP?
>
> begin tran
> create table tEmployeeSalary
> (
> employee_id int,
> salary money,
> effective_date datetime,
> is_active bit
> )
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 45000, 'dec 12, 2004', 1)
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 49000, 'mar 1, 2005', 1)
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 54000, 'june 20, 2005', 1)
> insert into tEmployeeSalary (employee_id, salary, effective_date,
> is_active)
> values (1, 67000, 'sep 10, 2005', 1)
> select * from tEmployeeSalary
> drop table tEmployeeSalary
> commit tran
>
> Thank you in advance for all suggestions.
> Gena
>|||Thanks David,
The data in my table does not allow nulls, although employee_id id is not
unique and the effective_date can repeat in cases when mistake was made and
I can allow to change salary on the same date or earlier (in this case
is_active will be set to 0).
And, thanks for "money" advice, good point.
I guess, I cannot get away from "TOP - ORDER" or subquery. I think I will
write a UDF and call it anytime I need a salary at a time point.
Another question, would it be a good idea to add a field - primary key
identity? emp_salary_id...
Thanks,
Gena
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1128008402.193130.131230@.g14g2000cwa.googlegroups.com...
> You don't really have every column nullable do you? What are the keys?
> Thanks for the DDL and sample data but it would be more helpful if it
> was accurate and complete. Assuming that (employee_id, effective_date)
> is unique, try this:
> SELECT employee_id, salary
> FROM tEmployeeSalary AS E
> WHERE effective_date =
> (SELECT MAX(effective_date)
> FROM tEmployeeSalary
> WHERE employee_id = E.employee_id
> AND effective_date <= '20050701') ;
> Be careful with the MONEY datatype. Precision is lost when you multiply
> and divide MONEY. In my opinion MONEY is unsuitable for financial data.
> (yes, seriously!)
> --
> David Portas
> SQL Server MVP
> --
>|||> Another question, would it be a good idea to add a field - primary key
> identity? emp_salary_id...
More important to add a constraint on the relevant business key. Here
I'm guessing:
ALTER TABLE tEmployeeSalary
ADD CONSTRAINT ak1_employee_salary
UNIQUE (employee_id, effective_date)
or:
ALTER TABLE tEmployeeSalary
ADD CONSTRAINT pk_employee_salary
PRIMARY KEY (employee_id, effective_date)
You can add the IDENTITY key if you need to reference it in another
table but otherwise it would be redundant. Every table should of course
have at least one candidate key.
David Portas
SQL Server MVP
--|||Hmm,
I cannot make PRIMARY KEY (employee_id, effective_date) because it will not
allow me to set different salaries for the same employee on the same date.
What if administrator made a mistake and noticed it few months later. I
cannot update it, I will need to add a new record with the same employee_id
and the same effective_date.
Thanks
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1128012586.541851.238920@.z14g2000cwz.googlegroups.com...
> More important to add a constraint on the relevant business key. Here
> I'm guessing:
> ALTER TABLE tEmployeeSalary
> ADD CONSTRAINT ak1_employee_salary
> UNIQUE (employee_id, effective_date)
> or:
> ALTER TABLE tEmployeeSalary
> ADD CONSTRAINT pk_employee_salary
> PRIMARY KEY (employee_id, effective_date)
> You can add the IDENTITY key if you need to reference it in another
> table but otherwise it would be redundant. Every table should of course
> have at least one candidate key.
> --
> David Portas
> SQL Server MVP
> --
>|||another option would be to have effective_from and effective_to columns
in the table|||So add a "created_date" or "modified_date" to the key. It seems your
original specification was too much of a simplified example. Adding
duplicate effective dates without further information and just updating
"is_active" would mean you would lose the audit trail containing the
sequence of changes.
David Portas
SQL Server MVP
--|||If you can't define a primary key, then you are sunk. SQL has no
order. If you have 2 entries for the same employee with the same
effective date, which do you wish to select? The higher salary? The
lower? The one entered last? (sorry, that information is not
available). select top ... has no meaning without an order by -
duplicates can appear in any order SQL Server wants to show them.
Given the requirements I have seen so far, you can't get there from
here.
You have gotten quite a bit of good, professional advice from the
posters in this thread. You may want to rethink things a bit.
Good luck.
Payson
News wrote:
> Hmm,
> I cannot make PRIMARY KEY (employee_id, effective_date) because it will no
t
> allow me to set different salaries for the same employee on the same date.
> What if administrator made a mistake and noticed it few months later. I
> cannot update it, I will need to add a new record with the same employee_i
d
> and the same effective_date.
> Thanks
>
> "David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
> news:1128012586.541851.238920@.z14g2000cwz.googlegroups.com...

Need advice re: SQL 2K + ColdFusion MX 6.1

Hello!

I recently upgraded my server from ColdFusion 5 to ColdFusion MX, and now I find I am unable to connect to my SQL 2000 datasources.

I am using Windows 2000 Server, latest service pack.

Now, I am a newbie when it comes to defining SQL users, so if anyone can walk/talk me through that process, including defining what my local SQL server is called, it may help.

Everything is running local on one machine...

Thanks!

RichardYou can name your datasource whatever you want. You define it in the windows ODBC setup. IE administrative tools -> ODBC. Then just set up the sql datasource in coldfusion using the SQL driver.

need advice on Update statement

I have a simple update statement that set sthe student's password to their id number:

update studemo set passwd = ident

ident is not part of the primary key but there is a unique, non-clustered index using that column

This has been running for over a hour on a table with 25K rows. Am I doing something basically wrong here?

If that is your exact statement, then what you aredoing is updating the password to ident for every row. I assume that that is the purpose, right?

If so, then the next question is a matter of hardware. Is this on a small machine, or a server class machine.

And, is the table clustered on password? ident being clustered wouldn't matter, but passwd would. Either way, if this is something you are doing "offline" then drop or disable indexes (2005 only) and you will certainly get better performance.

Basically, what I am trying to say is that there is no way to know from what you have told us so far, but you certainly do need to look at this being hardware oriented, so check perfmon and see what is being taxed.

|||SQL Server (2005) is on a server class machine. Hardware resources should not be an issue but I'll look into it.

The are no indexes using the password column. I'll check perfmon.|||

Add a loop logic and commit after every 1000 rows

The trick is to add a flag to the table (call it anything like UPDATE_FLAG , set it to some value and in where clause do a not equal to the same value :

SET ROWCOUNT 1000

UPDATE
TABLE1
SET
COLUMN = WHATEVER

, UPDATE_FLAG = '1'
FROM

TABLE2 (OR) WHATEVER
WHERE
UPDATE_FLAG != '1'

|||

You can perform the update in batches like below to reduce resource usage:

while(1=1)

begin

-- Update 500 rows at a time

update top(500) studemo set passwd = ident

if @.@.rowcount = 0 break

end

|||

Are your logs and data on the same drive? That could be a problem, especially if the rows are really big, and even worse if the value you are updating the value to is bigger than what it was.

I also should have mentioned to look for blocking :)

In perfmon I would look for large quantities of disk queuing and/or memory stress. Then implement one of the batching mechanisms (and probably drop indexes might help. This is esepecially true when you have large rows as page splits could be very frequent.) On such a small table building the indexes might take less time than maintaining them.

|||The log and data are on separate drives.

When I run the script from above:

while(1=1)

begin

-- Update 500 rows at a time

update top(500) studemo set passwd = ident

if @.@.rowcount = 0 break

end

I would have expect to see approximately 50 rows indicating 500 rows

had been updated since the table only has 25K rows. Before I cancelled

the update, I had more than 1000 messages that 500 rows had been

updated.

Weird ... to me.

Thanks for all the reponses so far.

|||What messages did you see? Does the table have any triggers for update? What does (select count(*) from studemo) return?|||Count = 25704.

Message: (500 row(s) affected) tr_slvswstuU fired, no change to address fields

There is one trigger that fires:

******************************************************

USE [fakeSISdata]
GO
/****** Object: Trigger [dbo].[tr_slvswstuU] Script Date: 08/30/2006 14:03:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create TRIGGER [dbo].[tr_slvswstuU] ON [dbo].[studemo]
FOR UPDATE
AS

set nocount on
--print 'tr_slvswstuU fired'

declare @.hcheck smallint,
@.mcheck smallint,
@.pcheck smallint,
@.ppass smallint

set @.hcheck = 0
set @.mcheck = 0
set @.pcheck = 0

Check for changes is Physical Address--
if exists (select i.suniq from inserted i,deleted d where
i.suniq = d.suniq and
(i.homeaddr1 <> d.homeaddr1 or
i.homeaddr2 <> d.homeaddr2 or
i.homecity <> d.homecity or
i.homezip <> d.homezip))
set @.hcheck = 1
--select @.hcheck
--Check for changes in Mailing Address-
if exists (select i.suniq from inserted i,deleted d where
i.suniq = d.suniq and
(i.mailaddr1 <> d.mailaddr1 or
i.mailaddr2 <> d.mailaddr2 or
i.mailcity <> d.mailcity or
i.mailzip <> d.mailzip))
set @.mcheck = 1

--Check for changes in Phone Number or Phone Type-
if exists (select i.suniq from inserted i,deleted d where
i.suniq = d.suniq and
(i.phnnumber <> d.phnnumber or
i.phntypec <> d.phntypec or
i.phnunlist <> d.phnunlist or
i.phnmsg <> d.phnmsg))
begin

declare @.oldphone char(10),
@.newphone char(10),
@.unlist smallint,
@.message smallint

set @.pcheck = 1
set @.oldphone = (select phnnumber from deleted)
set @.newphone = (select phnnumber from inserted)
set @.unlist = (select phnunlist from inserted)
set @.message = (select phnmsg from inserted)

--if @.oldphone is null or @.oldphone = ''
--set @.oldphone = 0

if exists(select phnnumber from inserted where (phnnumber is not null or phnnumber <> '') and phntypec = 'R')
set @.ppass = 1

if exists(select i.phnnumber from inserted i,deleted d
where i.suniq = d.suniq and
((i.phnnumber is null or i.phnnumber = '') and
(d.phnnumber is not null or d.phnnumber <> '') or added or
(d.phntypec = 'R' and i.phntypec <> 'R')))
begin
if exists(select phnnumber from deleted where phntypec = 'R')
set @.ppass = 2
end
end

-Call to siSp_syncaddr
--select @.hcheck,@.mcheck,@.pcheck
if @.hcheck = 1 or @.mcheck = 1 or @.pcheck = 1
begin
declare @.ident varchar(10)
set @.ident = (select ident from inserted)

if exists(select * from stucon where ident = @.ident and conmail11 = 1)
begin
--Call for multiple contacts--
if exists(select ident,count(*) from stucon where ident = @.ident and conmail11 = 1
group by ident having count(*) > 1)
begin
print 'tr_slvswstuU fired, called siSp_syncaddr for multiple contacts'
--select @.ident, 0, @.ppass, @.oldphone, @.newphone, @.unlist, @.message
--exec siSp_syncaddr @.ident, 0, @.ppass, @.oldphone, @.newphone, @.unlist, @.message
end
else
begin
--Call for sinlge contact-
declare @.conuniq int
set @.conuniq = (select conuniq from stucon where ident = @.ident and conmail11 = 1)

print 'tr_slvswstuU fired, called siSp_syncaddr for single contact'
--select @.ident, 0, @.ppass, @.oldphone, @.newphone, @.unlist, @.message
exec siSp_syncaddr @.ident, @.conuniq, @.ppass, @.oldphone, @.newphone, @.unlist, @.message
end
end
else
print 'tr_slvswstuU fired no stucon records where conmail11 = 1'

end
else
print 'tr_slvswstuU fired, no change to address fields'

set nocount off
**********************************************************************|||You will have to check the trigger logic. There are lot of SPs that are getting called from trigger code. It is not clear what they are doing. They could probably be adding rows to the same table. In any case, the UPDATE should affect same number of rows as those in the table if there are no new rows being added in the trigger. You can verify by accumulating the @.@.ROWCOUNT value in the batched update code and checking it at the end. You can use SET NOCOUNT ON to suppress the messages.

Need advice on system performance

Hi,

I am starting a new job next week. Part of what I am required to do is
a "system diagnostic" on a SQL Server 2000 box to determine what areas
can use improvement - this would include configuration settings,
backup/recovery, sql tuning, etc... and anything else I may not have
mentioned here!

What I need is a thorough and systematic approach to doing this. Can
anyone please give me advice, or point to a FAQ or other links that
discuss this. I am running out of time.

THANKS MUCHtootsuite,

This is one link you might want to check out.

http://www.microsoft.com/downloads/...&displaylang=en
Also, this site has a wealth of performance information:

http://www.sql-server-performance.com/
-- Bill

<tootsuite@.gmail.comwrote in message
news:1170959288.304029.270560@.l53g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

Hi,
>
I am starting a new job next week. Part of what I am required to do is
a "system diagnostic" on a SQL Server 2000 box to determine what areas
can use improvement - this would include configuration settings,
backup/recovery, sql tuning, etc... and anything else I may not have
mentioned here!
>
What I need is a thorough and systematic approach to doing this. Can
anyone please give me advice, or point to a FAQ or other links that
discuss this. I am running out of time.
>
THANKS MUCH
>

|||Thank you

- this link shows how to do a performance audit:

http://www.sql-server-performance.c...icles_audit.asp