Viewing 15 posts - 61 through 75 (of 230 total)
From any application (via ODBC or DB-LIBRARY) you can get the text returned from PRINT. In dblibrary you should use
int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity,char *msgtext,...
February 28, 2020 at 1:36 pm
5
Also with PRINT and RAISERROR
By that reasoning you should also include THROW, as well as modifying data in tables (particularly temp tables created by the caller).
Personally, I...
February 28, 2020 at 9:52 am
5
Also with PRINT and RAISERROR
By that reasoning you should also include THROW, as well as modifying data in tables (particularly temp tables created by the caller).
Personally, I would not...
February 28, 2020 at 8:39 am
Unless my memory is completely shot, back in version 1.1a (yes, I'm that old / started that young) it really stood for "Database Consistency Check". That was pretty much all...
February 17, 2020 at 7:49 am
Good one!
Until I understood the framing context, I used to do the LAST_VALUE as FIRST_VALUE(.. ORDER BY [col] DESC), which works out the same, but is likely a worse approach...
February 3, 2020 at 8:36 am
Nice question, which required a fair amount of reading and calculating back and forth.
But there is a small issue with the "correct" answer: There is one zero missing in the...
January 27, 2020 at 8:52 am
Opinion noted... However, I can more easily do things with DATETIME that can only be dreamed of with DATETIME2. Even Microsoft realized their mistake but, instead of fixing it,...
January 16, 2020 at 8:07 pm
Possibly, but then again, we all know how much accountants love guesswork, right 😀
Anyway, I could easily dig up examples from the EU where the conversion rates between the EURO...
January 16, 2020 at 4:02 pm
I think there are accounting standads that say 4 d.p. should be used for money calculations.
Well, that would depend on your country of operation, wouldn't it?
January 16, 2020 at 3:29 pm
Actually, MONEY is useful if only for documentation purposes. You could use decimal but why would you want to? Being an integer makes the type faster than decimal.
DATETIME does...
January 16, 2020 at 3:22 pm
Yes, because MONEY is a precise data type with 4 decimal places. It's implemented as a 64-bit integer, scaled down by 10000. That and DATETIME must be the two lamest...
January 16, 2020 at 3:06 pm
I think the extra decimal digit is because if you multiply a number with 2 decimal places by a number with 1 decimal place, the result can have 3...
January 16, 2020 at 2:44 pm
Yes, a strange result. Try this:
DECLARE @tmp1 FLOAT = 0.289;
SELECT CONVERT(decimal(38,36),ROUND(@tmp1, 2)*100),
CONVERT(decimal(38,36),ROUND(@tmp1, 2))*100
Well, that's no more strange than any...
January 16, 2020 at 2:29 pm
Well, 29 would have been too easy, and the title of the QOTD hinted at the result not being quite the obvious. Casting to INT always truncates decimals, so it...
January 16, 2020 at 10:11 am
Good one!
The problem is that casting to int always removes any decimals, and with the example, 0.289 is actually stored as a value which, when converted with the maximum number...
January 16, 2020 at 8:49 am
Viewing 15 posts - 61 through 75 (of 230 total)