Run SQL statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2013 09:34 AM
Hi, Is there a feature in ServiceNow where I can run a SQL statement on any table. The reason is I need to verify if the records I added/modified were correctly done in a table.
Thanks in advance for any response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2013 11:09 AM
The standard way of querying ServiceNow tables is with the GlideRecord object.
See http://wiki.servicenow.com/index.php?title=GlideRecord
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2013 12:10 PM
Hi,
There is a different way which can be useful from time to time.
In QuickNav type in 'Background', and select 'Scripts — Background'. Some systems reserve this tool for users with the security-admin role.
In the 'Run script (JavaScript executed on server)' box, just type in:
gs.sql("");
would be any valid sql statement
Example:
gs.sql("select count(*) from ")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2017 06:10 AM
This method is no longer allowed from Geneva version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 07:19 AM
But you can install ODBC driver and run the sql from interactive sql which comes with the odbc package