Saturday, September 16, 2023

READ BLOB in SQL Server

 


SELECT vrpid, vrvers, CAST ( CAST ( vrpodata AS VARBINARY(MAX)) AS NVARCHAR(MAX)) [POVal], vrvcd as DateChanged from pd920.f983051

where (vrpid like 'P%' or vrpid like 'R%')

and vrvcd > 12360

order by vrvcd DESC;

 

SELECT vrpid, vrvers, CAST ( CAST ( vrpodata AS VARBINARY(MAX)) AS NVARCHAR(MAX)) [POVal] from pd920.f983051

where (vrpid like 'P%' or vrpid like 'R%') and CAST ( CAST ( vrpodata AS VARBINARY(MAX)) AS NVARCHAR(MAX)) like '%:\%' or CAST ( CAST ( vrpodata AS VARBINARY(MAX)) AS NVARCHAR(MAX)) like '%\\%'

order by vrpid;

 

SELECT vrpid, vrvers, CAST ( CAST ( vrpodata AS VARBINARY(MAX)) AS NVARCHAR(MAX)) [POVal] from pd920.f983051

where (vrpid like 'P%' or vrpid like 'R%') and CAST ( CAST ( vrpodata AS VARBINARY(MAX)) AS NVARCHAR(MAX)) like '%:\%' or CAST ( CAST ( vrpodata AS VARBINARY(MAX)) AS NVARCHAR(MAX)) like '%\\%'

and vrvcd > 123060

order by vrpid;


select cast(substring(uobindta,1,8000) as varchar(8000)) from PD920.F98950;