473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Thoughts about the smart way to a task

I'm still a database newbie so I would like to solicit thoughts about
the smartest way to do something in sqlserver.

My company has a web application that we customize for each client.

We can do this because everything is database driven. We have
database tables that contain our HTML and database tables as well as
some standard tables for each database. We have an in house app that
lets us tweak both of these things and creates a new web site and
database tailored to each project.

Each of these sites has a table that stores a schedule are clients
use.

The records in this schedule table change when information in other
custom generated tables change.

My company currently uses a legacy foxpro app to update the schedule
table.
The foxpro app contacts sqlserver, reads a table with a list of tables
and scheduling information to check, checks each of those items and
updates the schedule table.

I would like to lose the foxpro app.

At first thought.........as a database newbie.......putting triggers
in each of the tables to update the schedule when something changes
seems the way to go.

However, since we change a part of the schema ( we have an app that
generates the database tables unique to each client ) for each client
I would like a scheme that would not involve having to create a
different trigger for each new table.

I would also like something that updates in real time. Right now the
foxpro app is executed once a day.

I was thinking of making a large stored procedure and putting an
identical call to that procedure in each table.

Each table would have the same trigger in it that would get fired when
the record was altered. It would call the stored procedure with
relevent arguments to update the schedule.

Does this sound like a smart way to solve this problem or am I not
thinking "database enough"?

Any thoughts are welcome.

I would like to build a better solution

Steve
Jul 20 '05 #1
1 1492
[posted and mailed, please reply in news]

Steve (st**********@yahoo.com) writes:
However, since we change a part of the schema ( we have an app that
generates the database tables unique to each client ) for each client
I would like a scheme that would not involve having to create a
different trigger for each new table.
It seems to me that this is the gist of your problem.

The "proper" design of this, would be to add one column to each table
that specifies which client the row relates to. If you do this, then
you have no problems with your triggers.

Now, you may not want to this, if you don't want clients to see each
other's data. This can be addressed with views, but if you don't do
things right, your clients may be very angry with you.

Yet an alternative would be give each client his own database. This
separates them even more. You could have a model database, from which
the app could create a new database with a RESTORE COMMAND. That model
database would include your tables and trigger.
I was thinking of making a large stored procedure and putting an
identical call to that procedure in each table.

Each table would have the same trigger in it that would get fired when
the record was altered. It would call the stored procedure with
relevent arguments to update the schedule.


But then that table would have to use dynamic SQL to determine which
tables to operate, and that would be messy.

Can you not just change the app, so that it creates the triggers too?
That seems to be the simplest solution.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

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

Similar topics

0
by: Funmi | last post by:
Hello I am creating smart documents using VB.NET and there are certain functionalities I cannot seem to implement with the available API, can you be of any help? Below is a list – Many thanks ...
27
by: Susan Baker | last post by:
Hi, I'm just reading about smart pointers.. I have some existing C code that I would like to provide wrapper classes for. Specifically, I would like to provide wrappers for two stucts defined...
5
by: Matthias Kaeppler | last post by:
Hi, I thought it'd be a better idea to start a new thread dealing directly with my problem. Okay, here's again what's happening: I'm storing boost::shared_ptrS in an std::set. I supposed that on...
3
by: Mike | last post by:
Task Center application on Win2k3 is slooooowww. Whenever I make a change or update to something in task center it takes 5 minutes to apply the changes or bring it up. It seems to lose focus on the...
16
by: Yong Hu | last post by:
Does the smart pointer never lead to memory leak? Thanks,
59
by: MotoK | last post by:
Hi Experts, I've just joined this group and want to know something: Is there something similar to smart pointers in C or something to prevent memory leakages in C programs. Regards MotoK
4
by: William Gill | last post by:
In my research to reeducate myself on color, I have come across a new (to me) concept of "web smart" color. Basically it restricts r,g and b to 16 values for a net of 4096 colors. I guess it's...
1
Stang02GT
by: Stang02GT | last post by:
Hello, I'm looking for your thoughts, ideas, and suggestions on this situation. I have recently been given the task to "fix" a menu within the companies intranet site. The current menu...
50
by: Juha Nieminen | last post by:
I asked a long time ago in this group how to make a smart pointer which works with incomplete types. I got this answer (only relevant parts included): ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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

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