October 21, 2009 at 9:03 am
I am tired of writing "CAST(0 as bit)" or "CAST(1 as bit)" whenever I need a constant that is typed as a bit. In many computer languages (e.g. C++, C#), you can add a suffix to a number to specify its type. Does anyone know if SQL has this? If not, is there a better way to write this?
October 21, 2009 at 9:04 am
Define a variable with type "bit" and assign the value to that. That's what I do.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 21, 2009 at 9:43 am
I do what GSquared does. Define a var.
Follow me on Twitter: http://www.twitter.com/way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply