Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to read UniqueIdentifier output parameter from a stored procedure via OLE DB Expand / Collapse
Author
Message
Posted Thursday, November 28, 2013 10:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 7, 2014 8:57 AM
Points: 6, Visits: 112
I have a stored procedure that takes some input parameters and returns a GUID as an output parameter. I want to call this SP using an OLE DB Source but the lack of any UniqueIdentifier data type within SSIS results in a data type conversion error.

"Error converting data type varchar to uniqueidentifier"

The SQL Command syntax is as follows:

EXEC ? = Control.dbo.PROC_FILESYS_Dir_Tree @FilePath = ?, @ObjectTypeFlag = 'File', @DirID = ? OUTPUT

The 1st 2 parameters (return code and file path) can be set no problem but when I try to map the 3rd (output) parameter to a string variable it throws the error. I realise this is a known problem but all of the online help seems to focus on GUIDs as input parameters and suggests adding {brackets} around the GUID value but for me this is an OUTPUT parameter so this advice does not help.

All suggestions appreciated.
Post #1518386
Posted Friday, November 29, 2013 1:44 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, September 5, 2014 12:02 AM
Points: 315, Visits: 344
Hi Tim

Imho you could convert it to char directly in SP.

Br.
Mike
Post #1518466
Posted Monday, December 2, 2013 3:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 7, 2014 8:57 AM
Points: 6, Visits: 112
Thanks for the suggestion Michal. Casting to string would of course be simple but the SP is widely used elsewhere and I don't want to be changing an output data type because that may break other interfaces.

On the face of it it seems that Microsoft don't support GUIDs across their technology stack which just beggars belief. As a developer I want to spend my time solving business problems but with Microsoft I seem to spend most of my time trying to code my way around gotchas in their implementation.
Post #1518820
Posted Monday, December 2, 2013 5:45 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, September 5, 2014 12:02 AM
Points: 315, Visits: 344
Hi Tim

I know that my previous advice was very trivial but the simplest solution is the best when you have a deadline to do sth.

Please take a look for that link: http://microsoft-ssis.blogspot.com/2011/02/create-guid-column-in-ssis.html
Imho it could help.

Br.
Mike


Post #1518861
Posted Monday, December 2, 2013 7:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 7, 2014 8:57 AM
Points: 6, Visits: 112
Thanks again. I don't feel that this approach really addresses my circumstances in a satisfactory way so I'll review my options.

Perhaps I'll develop SSIS wrapper SPs just to get around the problem. More likely I'll simply not use SSIS at all as I have an extensive T-SQL code library that can achieve what I want quickly.
Post #1518890
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse