I'm having some problems with the following Query:
SELECT v.idnum
,v.full_name
,convert(varbinary(max),s.signature) as Sig
FROM AppDB.dbo.v_People1 AS v INNER JOIN
OtherDB.dbo.Signatures AS s ON v.idnum = s.idnum
UNION
SELECT v.idnum
, v.full_name
, convert(varbinary(max), s.signature) as Sig
FROM AppDB.dbo.v_People2 AS v INNER JOIN
AppDB.dbo.Signatures AS s ON v.idnum = s.idnum
When i run them each of the queries separately without the union they execute quickly (<5 seconds), but when i run it using the union it's taking forever to execute (infact all it says is executing. I haven't seen it run successfully)
In OtherDB.dbo.Signatures the signature field is a varbinary(max) and in AppDB.dbo.Signatures the field is an image which is why i am using the convert expression. Does anyone know what the problem might be and how i can go about fixing it?
Thanks