OK here's a little thingy I just ran into, minor but curious.
I'm doing a big select into with a union, and I want to mark the source of rows with code like:
selectcast(0 asbit) as src, a, b, c, d, ...unionallcast(1 asbit) as src, a, b, c, d, ... into dbo.myfoo;
Just to be extra careful, I wanted to have the src field "not null", but the cast operator doesn't seem to like it.
selectcast(0 asbitnotnull) as myzero, -- invalid syntaxcast(1 asbitnotnull) as myone -- invalid syntaxinto dbo.zz_foo;
(also, too bad there's no way to specify a constant as bit!)
Any ideas?
Thanks.
Josh