cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

RDBMS - BLOB Data Type

ebarner
Former Employee

The post below was designed for the BLOB data type in SQL Server (2014) but similar concepts should work for other data sources as well.

Setup:
in SQL Server Mgmt Studio

CREATE TABLE [BLOBS](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Data] varbinary NULL,
[type] varchar NULL
CONSTRAINT [PK_BLOBS] PRIMARY KEY CLUSTERED
(
[Id] ASC
) ) ON [PRIMARY]

insert a few records based on the date types you want to try:

INSERT BLOBS( Data, type )
SELECT *,โ€˜jpgโ€™ FROM OPENROWSET (BULK โ€˜C:\FOLDER\FILENAME.jpgโ€™, SINGLE_BLOB) rs

INSERT BLOBS( Data, type )
SELECT *,โ€˜csvโ€™ FROM OPENROWSET (BULK โ€˜C:\FILDER\FILENAME.csvโ€™, SINGLE_BLOB) rs
โ€ฆ

The data itself when try to look at in SQL Server is not very meaningful:
8750e84823f7d75eb1ed1eaa2411bd2f4bd5cce9.png

With a snapLogic pipeline though, you can control what you want to have happen with it in a simple peipline that selects the data and converts $data into $content.

3c7614f8477ccb97aa53c8c6f6542188cd467420.jpg

SQL Select:
bab5b9d53fcdb031710b4a49563d16079b0169a0.png

data to content:
566b841b519fef6e55b78122006ca41153f904d5.png

Router
fb82280a7cac06cae2ce0dd9ddd89ec2668ad2e8.png

Document to Binary (both same configuration)
437fc5daefcd484b4dc9b2deaff2580bd7e42de6.png

CSV Parser (data preview):
ef654c21930f224664149d0a8cb31a7b97776316.png

File Writer
6cb0685530dde991e675db784651c707cf128bb8.jpg

I built in the bottom path as a future catch bucket for other data types added to my BLOB storage table.

0 REPLIES 0