Viewing 15 posts - 1 through 15 (of 17 total)
(start_date, end_date) pairs the idiom has been that a null in the end_date means "eternity"in that context
My experience has been that it means one of two possible outcomes:
1) Eternity in...
September 13, 2016 at 4:57 pm
OK, ... let this post/thread be a lesson to all you "know-it-all" experts. Lessons learned:
Not all UDF are bad, ... if correctly written, they can be tremendous for establishing and...
September 8, 2016 at 9:14 pm
Why we use a UDF instead of NullIf:
It's very simple, ... standards and code control.
Also, for those who have a really strong understanding of SQL, they will know that many...
September 8, 2016 at 8:20 pm
We don't want an error, because; if the divisor is zero, it means we merely haven't collected that data. In the example I gave, most obviously some homes do not...
September 8, 2016 at 5:51 pm
Our Function for Division:
CREATE FUNCTION dbo.Divide(@Numerator Real, @Denominator Real)
RETURNS Real AS
/*
Purpose: Handle Division by Zero errors
Description: User Defined Scalar Function
Parameter(s): @Numerator and @Denominator
Test it:
SELECT...
September 8, 2016 at 9:05 am
I've taken about an hour this morning to review my company's stored procedures and other queries to review where our function "dbo.Divide(@Numerator Float, @Denominator Float)" is used. It seems that...
September 8, 2016 at 8:48 am
from: Steve Jones - SSC Editor
There have been a few people saying NULL is the absence of a value, which isn't what I've learned in database theory. This is a...
September 8, 2016 at 6:53 am
OK, ... Pray tell, ... What possible use have you had for a raised error when division by zero occurs?
September 7, 2016 at 5:10 pm
I guess my point with this matter is that in 22+ years of database development, I personally have never had a need for returning an error message instead of a...
September 7, 2016 at 11:37 am
So that I can best understand the value you have described for the error message instead of returning NULL, please share with me a small block of code where such...
September 6, 2016 at 8:18 am
if divide by zero is allowed, it's possible to prove that 1=2
The above claim would only work in a logical proof if you identified that NULL= NULL . NULL !=...
September 6, 2016 at 6:30 am
To both replies thus far:
I beg to differ. The definition of "NULL" is a lack of a value. The definition of division by zero is a lack of ability to...
September 6, 2016 at 12:12 am
The below is what I have used in the past to accomplish the need for a Scalar UDF in MS SQL:
IF OBJECT_ID('tempdb..##fn_CORP_Divide') IS NOT NULL DROP PROCEDURE ##fn_CORP_Divide;
CREATE PROCEDURE ##fn_CORP_Divide...
August 29, 2016 at 2:56 pm
CREATE TABLE #TestUpdateA (ColA Char(1),ColB Int)
GO
CREATE TABLE #TestUpdateB (ColA Char(1),ColB Int)
GO
INSERT INTO #TestUpdateA VALUES('A','0')
GO
INSERT INTO #TestUpdateA VALUES('B','0')
GO
INSERT INTO #TestUpdateA VALUES('C','0')
GO
INSERT INTO #TestUpdateB VALUES('A','1')
GO
INSERT INTO #TestUpdateB VALUES('A','2')
GO
INSERT INTO #TestUpdateB VALUES('B','1')
GO
INSERT...
September 20, 2004 at 5:13 am
Viewing 15 posts - 1 through 15 (of 17 total)