You get NULL!
Well you get NULL when you don't cast. Say for example you do the following:
$dbh =
new PDO
([..
]);
$stmt =
$dbh->prepare
('SELECT accountid FROM dbo.Account');
$stmt->execute
();
echo $stmt->fetchColumn
();
// NULL
But when you do the following:
$stmt =
$dbh->prepare
('SELECT CAST(accountid AS varchar(36)) accountid FROM dbo.Account');
$stmt->execute
();
echo $stmt->fetchColumn
();
// "F05C92A1-3119-4206-A123-49A759AC99FB" I didn't think the casting would be necessary, since according to the manual: http://msdn.microsoft.com/en-us/library/aa226054(SQL.80).aspx the datatype 'uniqueidentifier' has implicit casts with multiple data-types. But I guess it's just one of those things...