Groups | Blog | Home
all groups > sql server new users > august 2005 >

sql server new users : Please help, basic questions


<Moshe>
8/25/2005 12:00:00 AM
[quoted text, click to view]

(untested)
In case you don't want to rollback the whole transaction which may include
more commands but just reject an insert, then an instaed-of-trigger will do
it.

[quoted text, click to view]

Louis Davidson
8/25/2005 12:28:30 AM
1. Decimal for sure. Float is an approximate type, which is not good for
money types.

2. Sorry for you :) No, I am most sure that they are not. You have to
stop using the UDDT (like put the data into a compatible type using ALTER on
all columns.) Alter your UDDT, then re alter all of the tables. For the
most part it is suggested to avoid them unless they give you a great payoff.

3. Define reject. generally speaking just ROLLBACK TRANSACTION in the
trigger and everything will stop when the trigger ends.

--
----------------------------------------------------------------------------
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)

[quoted text, click to view]

-Qmem-
8/25/2005 1:10:11 AM
Hi all,

1- Which better data types for money fields, float or decimal? Which i use?
(... my money type requires 6 decimal point ...x.123456)

2- I m using User Defined Data Types. Is the UDDT supported Alter with
data? When i think change in future.

3-How do i reject new records in triggers?

very thanks for help.
(sorry my poor language)

Louis Davidson
8/25/2005 9:30:55 AM
True, that was why I suggested they define reject. Instead of triggers are
great for just ignoring input (or redirecting it into an exceptions table)
but beware that if you are using identity columns you will lose
scope_identity() power because the scope of the insert is now the trigger
instead of the actual insert statement.

--
----------------------------------------------------------------------------
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)

[quoted text, click to view]

AddThis Social Bookmark Button