As far as I know you can’t operate on a database directly from InDesign. But you can get an XML file from SQL database and import it into InDesign document and process it with a script. I did a thing like that once: it was a script for a classified section of a daily newspaper. They gather information via web interface into SQL database then export it into an XML file, then the script imports the XML-file into the classified section of the newspaper and applies the necessary formatting to the text and places images. It was a ‘run the script and everything is almost done’ solution.
If you are interested you can download this script from here:
I have something like that running at my job. We use Macs so we need the Actual Technologies system plug in to access the MS-SQL server directly. But our DB guys have made a procedure that gets data based on one value that is passed to it. The user runs a script, well actually they enter a number in a field in my app and then press a button, and data is returned. It's not going right into InDesign but once you have the data, you can work with it from there.
I'm running an Applescript, but I bet similar things could be done with JS or VB, or maybe the previous poster's solution will work for you too.
Thank you both very much, I really appreciate the information. Between the two it sounds like there is a solution out there. We're going to trial a couple plugins this afternoon to see if we can get the data, and once we have it can work with it via script. I'm going to download the script you provided and it should give us a big jump start. Thanks!