cancel
Showing results for 
Search instead for 
Did you mean: 

Assistance needed with Data- SQL Server

Anonymous
Not applicable
I am fairly new to Blue Prism and need assistance with using the Data-SQL Server Business Object. I have been assigned a task to store all the records from a table to a collection. I have implemented two processes so far : 1) Set Connection which works correctly, 2) Get Collection with the SQL value as "Select * from TableName;" Upon execution of this process the following error is thrown "Internal : Unexpected error Can't convert System.Guid to a Blue Prism data type." Can someone tell me what I am doing wrong or if I'm missing steps? Many thanks
6 REPLIES 6

John__Carter
Staff
Staff
Hi Keagan - there isn't an exact fit between the datatypes that SQL uses and the ones that BP uses, GUID being one of them. Basic text and numbers work fine, but you have to handle more specialised datatypes differently. So rather than do a SELECT *, you'll have to be explicit with the column names, eg SELECT [First Name], [Last Name]. For the GUID, use SQL to convert the GUID to text so that BP will be able to accept it, eg SELECT CAST([GUID Column] AS CHAR(36)) AS [GUID Column]

Naga_MounikaGel
Level 3
Hi John, I tried giving ""SELECT [id] FROM "" but still it is giving me same error. Can you please help further.   Regards, Naga

John__Carter
Staff
Staff
Hi Naga - as per my previous post, BP datatypes don't align exactly to the datatypes in SQL Server, and you may need to enhance your query so that the datatypes in the query results are a good fit for BP data types. Maybe you need to find out what [id] is and how you might use CAST or CONVERT in your query.

Naga_MounikaGel
Level 3
Thanks John, It worked for [id].. :). But what if i need all the columns at a time? how to use if need to query as Select * from Table Name

John__Carter
Staff
Staff
You can't use SELECT * if you need to cast or convert some column datatypes. You'll have to explicitly name all the columns in the query statement.

Naga_MounikaGel
Level 3
okay fine thank you John.