Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / DTS / July 2008

Tip: Looking for answers? Try searching our database.

Setting Boolean Var in Execute SQL task

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 30 Jul 2008 02:52 GMT
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::pDataExists" differs from the current variable type

please help,
tia - chris
matteus - 30 Jul 2008 08:51 GMT
> I have a boolean type variable - pIsExists
>
[quoted text clipped - 13 lines]
> 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.

;)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.