<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can DB Connect run stored procedures in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154815#M7799</link>
    <description>&lt;P&gt;I'm running two SP's almost for an year in Splunk DB Connect v1.&lt;/P&gt;

&lt;P&gt;I also have two Data Inputs running daily (which are calling those SP's from a SQL DB) to populate two different indexes.&lt;/P&gt;

&lt;P&gt;And  I never had problems. How is this possible? Since it's not supported?&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2016 14:30:26 GMT</pubDate>
    <dc:creator>joao_amorim</dc:creator>
    <dc:date>2016-09-13T14:30:26Z</dc:date>
    <item>
      <title>Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154811#M7795</link>
      <description>&lt;P&gt;Can you anyone help me if its possible to run stored procedures from DBCOnnect?&lt;BR /&gt;
I didnt find any documentation on this?&lt;/P&gt;

&lt;P&gt;If its possible can anyone give a sample/example on how to run??&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2014 07:30:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154811#M7795</guid>
      <dc:creator>adityapavan18</dc:creator>
      <dc:date>2014-02-18T07:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154812#M7796</link>
      <description>&lt;P&gt;Hi. Splunk DB Connect currently does not support stored procedures. This feature might be available in future releases, depending on demand.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2014 07:22:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154812#M7796</guid>
      <dc:creator>sroback_splunk</dc:creator>
      <dc:date>2014-02-19T07:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154813#M7797</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There is a workaround to be able to query SPs. See &lt;A href="https://answers.splunk.com/answering/386947/view.html"&gt;https://answers.splunk.com/answering/386947/view.html&lt;/A&gt; for more info.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 02:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154813#M7797</guid>
      <dc:creator>davidpaper</dc:creator>
      <dc:date>2016-03-28T02:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154814#M7798</link>
      <description>&lt;P&gt;SQL Server also supports user defined functions: &lt;A href="https://msdn.microsoft.com/en-us/library/ms191320.aspx"&gt;https://msdn.microsoft.com/en-us/library/ms191320.aspx&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2016 18:55:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154814#M7798</guid>
      <dc:creator>gblock_splunk</dc:creator>
      <dc:date>2016-05-31T18:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154815#M7799</link>
      <description>&lt;P&gt;I'm running two SP's almost for an year in Splunk DB Connect v1.&lt;/P&gt;

&lt;P&gt;I also have two Data Inputs running daily (which are calling those SP's from a SQL DB) to populate two different indexes.&lt;/P&gt;

&lt;P&gt;And  I never had problems. How is this possible? Since it's not supported?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 14:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154815#M7799</guid>
      <dc:creator>joao_amorim</dc:creator>
      <dc:date>2016-09-13T14:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154816#M7800</link>
      <description>&lt;P&gt;Had a similar problem (MSSQL Server) trying to setup an Input which executed xp_readerrorlog.  If you try:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXEC sys.xp_readerrorlog 0;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You will receive an error that dbxquery does not support stored procedures.  However, on a lark I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXEC('sys.xp_readerrorlog 0');
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this worked.  Apparently, we can execute TSQL strings; so, all you have to do is wrap your stored procedure call in an EXECUTE command which executes a string as an SQL command.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 16:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154816#M7800</guid>
      <dc:creator>John_L</dc:creator>
      <dc:date>2016-10-19T16:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154817#M7801</link>
      <description>&lt;P&gt;Ok but idk cause I don't has that kind of error since I execute my SP's like you said the first time, EXEC user.sp_name&lt;BR /&gt;
And if you need to pass variables to them it's EXEC user.sp_name @VARIABLE = value&lt;/P&gt;

&lt;P&gt;Try that, it could be your solution.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:30:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154817#M7801</guid>
      <dc:creator>joao_amorim</dc:creator>
      <dc:date>2020-09-29T11:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154818#M7802</link>
      <description>&lt;P&gt;It was not supporting earlier and is now included in Splunk 7 and above. I tried this and this just worked fine for me -&lt;/P&gt;

&lt;P&gt;| dbxquery connection="connection_name" query="EXEC [DatabaseName].[user].StoredProcedureName"&lt;/P&gt;

&lt;P&gt;ex: | dbxquery connection="ConOne" query="EXEC [MyDB].[dbo].sp_Merge_Tables_AB"  - where ConOne is the connection name, MyDB is the Database instance name, dbo is the user and sp_MergeTables_AB is the Stored Procedure that I have written which is intended to merge two tables. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154818#M7802</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2020-09-29T19:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can DB Connect run stored procedures</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154819#M7803</link>
      <description>&lt;P&gt;I don't understand what is the issue with stored procedures? When you do it like "EXEC dbo.StoredProcedure" it's not even a parameterized stored procedure call! It is sent to a SQL Server as a simply query. Why DB Connect even bothered about the content of the query? Send it to the server as is and get a result. What could be easier? Do you have parse it or what? It's so confusing.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 00:52:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Can-DB-Connect-run-stored-procedures/m-p/154819#M7803</guid>
      <dc:creator>asuprun</dc:creator>
      <dc:date>2019-04-18T00:52:52Z</dc:date>
    </item>
  </channel>
</rss>

