Re: Maths Formula Question
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 09/28/04
- Next message: Aaron [SQL Server MVP]: "Re: How do I do this?"
- Previous message: David Browne: "Re: insert data into Oracle using a trigger in SQL Server"
- In reply to: Ian: "Re: Maths Formula Question"
- Next in thread: Ian: "Re: Maths Formula Question"
- Reply: Ian: "Re: Maths Formula Question"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Sep 2004 00:43:35 +0200
On Tue, 28 Sep 2004 11:12:00 +0100, Ian wrote:
>Hi Hugo
>
>This is a really great idea. but there is triggers on the table that keep
>all the instructions in and incremental order so should I do that then the
>data will just change back before I finish.
>
>The way I am currently doing it is holding the data in a temp table that I
>want duplicated then I do an insert into table and the trigger then only
>fires once.
Hi Ian,
Did you consider getting rid of the trigger and doing all updates to the
table through stored procedures (that incorporate the part of the trigger
logic that's relevant to the operation carried out in the proc).
The reason I suggest this is this: you are basically storing integer data.
But the way you are now planning to perform your inserts forces you to
declare the column as a numeric datatype, as you now need to store
fractions - that will immediately afterwards be replaced by integer data!
Not very efficient.
You'll also have to find out the number of digits needed to the right of
the decimal point to hold seperate values for the maximum number of rows
you'll ever have to insert (and once you defined that maximum, you can
expect a user to try it with just one or two more - Murphy's law always
kicks in in cases like this).
If against all advise you do decide to take this path, just forget about
the complicated formula and use fixed increments (the minimum that the
declared datatype for the column can handle). So if your datatype is
numeric(15,4), your rows "between" 12 and 13 would be numbered 12.0001,
12.0002, 12.0003, ...., and finally 12.0007.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Aaron [SQL Server MVP]: "Re: How do I do this?"
- Previous message: David Browne: "Re: insert data into Oracle using a trigger in SQL Server"
- In reply to: Ian: "Re: Maths Formula Question"
- Next in thread: Ian: "Re: Maths Formula Question"
- Reply: Ian: "Re: Maths Formula Question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|