Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Article: What's new in SQL Server Yukon
 Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Lavos
Posting Yak Master

USA
200 Posts

Posted - 09/03/2003 :  01:21:53  Show Profile  Reply with Quote
I didn't say the different between 2 valued logic and 3 valued logic was minor, but I certainly don't think it's insurmountable. The difference in solving a 3 dimensional rubik's cube and a fourth dimensional is pretty big IMHO to, but people seem to be mastering it. You said "Try setting a boolean to null". I can only assume you meant assigning it to a variable since saying "Assign NULL to TRUE" is pretty much, err, well.....

You asked for a boolean type, I said a bit was more or less a boolean type, though I'll grant it can be null which as you've said before you don't like. Although, YES, you have to specify @var=1 to test for "true", you turned around and said you could construct a datetime data-type from booleans, so what's the difference? Syntactic sugar? does the =1 part really matter all that much?

I still don't see why NULL's are so necassarily evil in your opinion. Do you have a link to a paper on the subject? Is it experience with people getting confused? Is it Dogma? Something else that just caught my eye, but were you also implying that with a boolean data type, NULL's could be removed? or were those statements just in the same paragraph?


----------------------
"O Theos mou! Echo ten labrida en te mou kephale!"

"Where theres a will, theres a kludge." - Ken Henderson
Go to Top of Page

eyechart
Flowing Fount of Yak Knowledge

USA
3575 Posts

Posted - 09/03/2003 :  01:31:46  Show Profile  Reply with Quote
Ding, lightbulb just turned on - Thanks byrmol.

I just had to point out that this is one hell of a message board. I learn new stuff, or have the old stuff pounded back into my brain, on a daily basis when I visit here. Good work all.

Guess I'll have to dig out that relational algebra text again..


-ec
Go to Top of Page

byrmol
Shed Building SQL Farmer

Australia
1591 Posts

Posted - 09/03/2003 :  02:27:59  Show Profile  Reply with Quote
I should have said "Try setting a boolean variable to NULL"...

Perhaps you didn't say it is minor but that was the feeling I got and is reinforced by the insurmountable quote.

"More or Less" Which is it? You are confusing representation versus physical storage.
Your computer converts bits into images, strings and dates. And AFAIK a computer bit is ON or OFF not ON, OFF or MAYBE (where MAYBE equals MAYBE sometimes).. I would like to see people build a computer system based on that...NOT!!!! I am fully aware of trinary state computers but all the states are actual values and not something metaphysical like NULL.

Frankly I don't care if the Boolean is represented as COOL and GETSTUFFED as long as there is no third "value"!!!

A NULL equals what exactly? This is why I really don't like them, but also because they screw up aggregations, butcher optimisation, allow poor design decisions, have no type and of course keep my beloved boolean from ever existing..

I was implying that NULL's would HAVE to be removed if a boolean type is introduced, unless of course you want to allow NULLS in some types and not others.. I am not sure the DBMS's programmers would be happy about that coding that requirement.

DavidM

"SQL-3 is an abomination.."
Go to Top of Page

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 09/03/2003 :  08:09:47  Show Profile  Visit robvolk's Homepage  Reply with Quote
Exactly what is preventing you from creating a user defined Boolean datatype, using a bit, and binding a NOT NULL rule to it? You can then declare a column or variable of that data type. Is this a "true" boolean? (pardon the pun) Maybe not, but it looks like a duck, walks like a duck, and quacks like a duck, so who cares? Just because the RDBMS doesn't FORCE you to have a boolean does not mean it PREVENTS you from creating one. The same thing applies with Nulls, there's nothing in SQL or SQL Server that forces you to allow them.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 09/03/2003 :  12:56:27  Show Profile  Reply with Quote
quote:

A NULL equals what exactly?



Oh the poor disparaging of NULL..

Since it doesn't exist (means there is no value), I'm sure it's feelings can't be hurt...

Nulls is not a third value...it is the absence of a thing...

MOO

Brett

8-)

SELECT @@POST=NewId()

That's correct! It's an AlphaNumeric!
Go to Top of Page

Lavos
Posting Yak Master

USA
200 Posts

Posted - 09/03/2003 :  19:57:30  Show Profile  Reply with Quote
Hi Rob, That'd work fine for columns but not for variables, unless I'm misremembering my experimenting when I was first learning SQL Server. IIRC,
DECLARE @Var <yourtype> NOT NULL

was a syntax error, and the server would ignore a not null constraint on a user defined type if you used it for a variable. (Which I think makes a certain backwards type of sense. When you first declare a variable, it is always set to NULL initially, which means that variables would have to be required to be set to null.)

For all intents and purposes, bit is a boolean data type missing synctactic sugar, meaning it's probably more of pain to work with than strictly necassary. Does it have 3 states? yes, but I'm sure most cases could be re-worked to eliminate nulls if you really want to.

Byrmol, sorry if we're getting off on the wrong foot here, but usually if I sound silly it's due to stress induced posting and no offense is really intended. (I'm just a little, err, straightforward with my style of communication.) Now with that said, I did take your tone to be a little bit patronising which I probably took a little offense to. If you didn't mean it that way, then I'm sorry for projecting. If you did, then I would appreciate it if you wouldn't do that in the future.


----------------------
"O Theos mou! Echo ten labrida en te mou kephale!"

"Where theres a will, theres a kludge." - Ken Henderson
Go to Top of Page

byrmol
Shed Building SQL Farmer

Australia
1591 Posts

Posted - 09/03/2003 :  21:17:31  Show Profile  Reply with Quote
[quote]
but it looks like a duck, walks like a duck, and quacks like a duck, so who cares
[/quote

But it is still not a duck! And I care.

There is nothing syntactic about it. There is a huge logical difference.

Don't worry about it Lavos, no offence taken or intended. My style is just as terse as yours.
I mostly sound patronising because I know the audience is not just yourself and Rob but also people who are new to the field.

I spend way to much time fixing terrible schemas.. Most of the problem is an excess use of nulls caused by poor design decisions simply because they are available. Add a lit bit of Dogma to that and I damn well despise the things.

That said I do use them when I can't find a good default or trying to avoid them causes a large increase in the number of tables used. If I can assign a business value to the NULL then all the better... The StartDate, EndDate problem is a good example.


DavidM

"SQL-3 is an abomination.."
Go to Top of Page

Lavos
Posting Yak Master

USA
200 Posts

Posted - 09/04/2003 :  23:31:27  Show Profile  Reply with Quote
Ahh yes, Now compound the problem of nulls in the datasource with trying to expose those same columns as value types in business objects using a CLS compliant language and you'll know a minor part of my own project from hell. (*YAY*, guardian values all around, *YAY*) (of course, being told that we didn't need to do design and analysis because it'll just lead to paralysis, and we've been told what we need to build, so just get it coded already, is a much bigger part of it. At least the guy in charge of the project has enough time to do 30 rip off icons and graphics so we can avoid contracting a graphic artist and ignore requests for clarification and information. *sob*)

Blech.

I'll agree NULL's are over-used. It seems that the level of knowledge that a lot of the people I've come across think they need to have before being an "advanced" relational database person is pitifully small. On the other hand, I still don't see myself taking your mimimalist approach to NULL's any time soon because I still see them fairly useful in quite a few cases. :)

Now if you'll excuse me, I have to go figure out how to seemlessly support *either* SQL Server or any random version of DB2, cause the customer could have either.


----------------------
"O Theos mou! Echo ten labrida en te mou kephale!"

"Where theres a will, theres a kludge." - Ken Henderson
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000