John Turner
John Turner

Reputation: 45

Create a file in SQL Server 2008 R2 and convert it to image datatype without writing it to disk?

I am working in SQL Server 2008 R2.

I am currently generating PDF reports by building the pdf as plaintext (based on this: http://www.sqlservercentral.com/articles/Miscellaneous/creatingapdffromastoredprocedure/1104/ )

It builds the body in plaintext then saves it to a folder using sp_OACreate with the .pdf extension. It is actually faster than SSRS in this case; we are generating 5k-100k pdfs (historical transaction data for our customers' customers)

I then have to load these files into an image column so the clients can access their report through the software.

Is there a way to generate the file and convert it to an image without writing it to the disk and then reloading it?

Upvotes: 1

Views: 458

Answers (1)

fabulaspb
fabulaspb

Reputation: 1263

For SQL Server you can program stored procedure on .NET language (C#, VB...) Inside .NET assembly write code for generating PDF reports. Then you only have to execute this stored procedure and save it result to database table.

Upvotes: 1

Related Questions