dbTalk Databases Forums  

Setting Boolean Var in Execute SQL task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Setting Boolean Var in Execute SQL task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris
 
Posts: n/a

Default Setting Boolean Var in Execute SQL task - 07-29-2008 , 08:52 PM







I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris

Reply With Quote
  #2  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM






On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
  #3  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM



On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
  #4  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM



On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
  #5  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM



On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
  #6  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM



On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
  #7  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM



On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
  #8  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM



On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
  #9  
Old   
matteus
 
Posts: n/a

Default Re: Setting Boolean Var in Execute SQL task - 07-30-2008 , 02:51 AM



On Jul 30, 3:52 am, Chris <Ch... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
I have a boolean type variable - pIsExists

I created an Execute SQL task to set this variable -
ResultSet: Single Row
SQLStatement: select 0 as test

I also tried: select 1 as test
select 'True' as test

REsult Set test mapped to pIsExists

Error: Execute SQL Task: An error occurred while assigning a value to
variable "pDataExists": "The type of the value being assigned to variable
"User:DataExists" differs from the current variable type

please help,
tia - chris
Try converting to bit data type the field your are using in the select
statement. Like:
SELECT CAST(0 as bit) as Bool
SELECT CAST('True' as bit) as Bool
Both worked here.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.