sql server programming:
[quoted text, click to view] >> When the users place orders, the customerid and employeeid are
optional. <<
Doesn't that seem to be strange business practice? Where do you sent
all these "mystery orders" since you have no idea who paid for them? If
employees enter orders, how do they log on? Or is there a general
"Embezzler" password that employees who want to ship those orders to
their friends can use?
[quoted text, click to view] >> I'm going to insert a row in customers table for unregistered
customers and a row into employees table for orders inserted without
employeeid <<
Then, based on the DDL that you have never shown us, registration is an
attribute of a customer? So I can buy stuff from you BEFORE you find
out that I am terrorist stolen credit cards?
I can see moving some orders to a "pending" status and creating a new
customer when you take the order, but there is no excuse for not
requiring an employee id. Well, if you are really trying to set up the
system to invite embezzlement, employee theft and other crimes.
[quoted text, click to view] >> This query is very important to us and because of orders table size,
it has become very slow. <<
Are you running over a terabyte? This query is more important than basic
accounting checks and balances are? And I would bet that queries are
slow because of poor schema design, not table size. Usually, a schema
with this lack of controls tends to accumulate garbage and orphan rows
in the tables until it chokes.
You probably have more troubles than can be handled on a Newsgroup.
--CELKO--
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are. Sample data is also a good idea, along with clear
specifications.
*** Sent via Developersdex
http://www.developersdex.com ***