On 1 Apr 2004 03:24:20 -0800, Loi Tan Vo wrote:
Hi,
I have boolean values in a table for ex. Federation.
No you don't, not in SQL Server. SQL Server doesn't have a boolean
datatype. I presume you meant to write that you have a column with
datatype bit?
And I want to
select following
Select 'Insert into' + member + 'test' as test1from federation
Then I get error message
Server: Msg 403, Level 16, State 1, Line 1
Invalid operator for data type. Operator equals add, type equals bit.
Someone can help me out of it.
Thanks an advance
- Loi -
Without seeing your DDL, sample data and required output, it's hard to
tell what you want. However, the code you provided can be fixed by
* inserting a space between test1 and from
* using cast to convert the datatype from bit to character.
Sample repro (fixed):
use MyTestDB
go
create table federation
(member bit not null)
go
insert federation values(1)
insert federation values(0)
go
Select 'Insert into' + cast(member as char(1)) + 'test' as test1 from
federation
go
drop table federation
go
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)