Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As a requirement, I have to check for a certain condition on some data in the database, if the condition is true, then I have to create a pdf report and store it on a table.

I have everything set up as a T-SQL SP except the pdf report part.

Is there anyway to execute an SSRS Report, export it to PDF and store the pdf in a varbinary column directly from T-SQL ?

Otherwise the only solution would be creating a Windows Service to do this (I Know how to do this but the T-SQL way would give me more flexibility).


share|improve this question

migrated from Sep 2 '12 at 3:04

This question came from our site for professional and enthusiast programmers.

There are code examples around ( that show you how to render a report directly to a PDF. I imagine you could use that, store the file in a temp location and then insert the the file into the DB. – D.S. Aug 31 '12 at 17:40
I Know how to do that, i wanted to know if i could do it using t-sql for it's flexibility. Thanks – Calbertoferreira Sep 1 '12 at 9:52

You should be able to write any sort of code in .Net and connect it into SQL Server. See for an example.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.