- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 11:26 AM
Hello Community,
Can someone point me to an example or provide code snippet to make a JDBC Connection and do a sql insert ?
I am trying to insert a record into a table that exists in external database from script include. All the examples I could find are using MIDServers JDBCProbe.
I can't use
Webservice - ( Reason : External Database don't have support for this)
MIDServer - ( Reason : No Mid Server )
JDBCProbe - ( Reason : No Mid Server )
Orchestration - ( No subscription for Orchestration )
Thanks,
Praveen
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 11:37 AM
I don't think you have a way to do this without the use of a MID server. You mentioned that you don't currently have a MID server. Have you considered just...getting one? There's no cost or licensing other than the computer you install it on (if you have to buy one or spin up a VM). It's useful for plenty of things, and there is something to be said about avoiding the "square peg / round hole" situation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 06:53 AM
Hi Patric,
Thanks for your help.
I am new in Servicenow.
I am importing records from sql database to Servicenow table.
and Also, Now I am now am trying to insert servicenow table items to sql database table.
Please give me step by step process.
Regards,
Sreenivas

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 08:09 AM
Importing records from SQL to ServiceNow is done with a JDBC data source, which you can read about configuring here.
Importing records from ServiceNow to your SQL database is entirely dependent on your SQL manager application, whether that be MS SQL Server Management Studio or Oracle or whatever.
The general process would be:
- Use an Export Set to get your data onto the MID server as a CSV file.
- Have the SQL management application import the CSV to your table using a transform map that you define. The way in which you do this is 100% dependent on what kind of database you are using.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 09:18 AM
Hi Patric,
Thanks for your Help.
Sorry for bothering you again.
I went through the article and if I understand correctly it talks about copying the ServiceNow data to SQL manually.
However in my case , I would like to copy the data from ServiceNow table to SQL table automatically.
Basically I am looking to schedule the process of copying from ServiceNow to SQL to happen every hour/day/week/month
Can you kindly guide me on this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2018 10:07 AM
You would configure your SQL manager to do this on a recurring basis. With MS SQL, the directions for setting up a job are here. I'd recommend engaging a DBA to assist with this if you are unfamiliar with this process.
From ServiceNow's end, you can tell the Export Set to export automatically every hour/day/week/month etc. - it's described in the Export Sets documentation I linked from earlier.
So you will have the Export Set generated on a recurring basis AND configure your SQL manager to import the file on a recurring basis, and that's it.