<?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: How to Call SQL Server Stored Procedures in JMP 18.1.1 in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824513#M100407</link>
    <description>&lt;P&gt;The syntax is a little different for SQL Server. In the example below, I'm asking the AdventureWorks2019 database (a standard one supplied by Microsoft) to execute the stored procedure "USPGetEmployeeManagers" for BusinessEntityID 285 (a person named Syed Abbas). The script returns the table in the screenshot.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//dbc copy/pasted from a different sql query made by Query Builder
dbc = Create Database Connection ("ODBC:APP=JMP;DATABASE=AdventureWorks2019;DESCRIPTION=SQLEXPRESS;DSN=AdventureWorks;TRUSTED_CONNECTION=Yes;WSID=mycomputername;");

//sql copy/pasted from running stored procedure in SQL Server Management Studio
sql_statement = "
DECLARE	@return_value int

EXEC	@return_value = [dbo].[uspGetEmployeeManagers]
		@BusinessEntityID = 285

SELECT	'Return Value' = @return_value
";

//run the stored procedure
execute sql(dbc, sql_statement);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jed_Campbell_0-1734627068273.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71429i2105DCDCFCD2095F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Jed_Campbell_0-1734627068273.png" alt="Jed_Campbell_0-1734627068273.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2024 16:52:04 GMT</pubDate>
    <dc:creator>Jed_Campbell</dc:creator>
    <dc:date>2024-12-19T16:52:04Z</dc:date>
    <item>
      <title>How to Call SQL Server Stored Procedures in JMP 18.1.1</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/823808#M100305</link>
      <description>&lt;P&gt;Hello - I'm a relative newbie to JMP, but need assistance establishing a connection to several SQL Server database stored procedures.&amp;nbsp; The SPs have a few input parameters that need to be supplied at runtime, and they will generate recordsets of data based on that.&amp;nbsp; I've tried using just the ODBC System DSN approach, but the SPs aren't exposed there, so I've read that JSP is perhaps an option.&amp;nbsp; Any snippets of code or best practices are very appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 20:01:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/823808#M100305</guid>
      <dc:creator>BryGuy63</dc:creator>
      <dc:date>2024-12-16T20:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Call SQL Server Stored Procedures in JMP 18.1.1</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824277#M100371</link>
      <description>&lt;P&gt;Not sure if this will work for SQL Server, but for Oracle you can do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;sql_statement = "BEGIN myusername.pkg_util.send_email('Success'); END;";
execute sql(dbc, sql_statement);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Control will return to JMP when the procedure is done.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 16:24:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824277#M100371</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2024-12-18T16:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Call SQL Server Stored Procedures in JMP 18.1.1</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824513#M100407</link>
      <description>&lt;P&gt;The syntax is a little different for SQL Server. In the example below, I'm asking the AdventureWorks2019 database (a standard one supplied by Microsoft) to execute the stored procedure "USPGetEmployeeManagers" for BusinessEntityID 285 (a person named Syed Abbas). The script returns the table in the screenshot.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//dbc copy/pasted from a different sql query made by Query Builder
dbc = Create Database Connection ("ODBC:APP=JMP;DATABASE=AdventureWorks2019;DESCRIPTION=SQLEXPRESS;DSN=AdventureWorks;TRUSTED_CONNECTION=Yes;WSID=mycomputername;");

//sql copy/pasted from running stored procedure in SQL Server Management Studio
sql_statement = "
DECLARE	@return_value int

EXEC	@return_value = [dbo].[uspGetEmployeeManagers]
		@BusinessEntityID = 285

SELECT	'Return Value' = @return_value
";

//run the stored procedure
execute sql(dbc, sql_statement);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jed_Campbell_0-1734627068273.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71429i2105DCDCFCD2095F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Jed_Campbell_0-1734627068273.png" alt="Jed_Campbell_0-1734627068273.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 16:52:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824513#M100407</guid>
      <dc:creator>Jed_Campbell</dc:creator>
      <dc:date>2024-12-19T16:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to Call SQL Server Stored Procedures in JMP 18.1.1</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824702#M100446</link>
      <description>&lt;P&gt;Hi Jed - I appreciate the detailed response, including an example with an SP parameter.&amp;nbsp; I'll assume that if the SP returns multiple rows for a given set of parameters, that can be dealt with efficiently within JMP.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 17:47:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824702#M100446</guid>
      <dc:creator>BryGuy63</dc:creator>
      <dc:date>2024-12-20T17:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to Call SQL Server Stored Procedures in JMP 18.1.1</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824735#M100447</link>
      <description>&lt;P&gt;Yes, the JMP table captures however many rows the query sends back.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 20:32:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Call-SQL-Server-Stored-Procedures-in-JMP-18-1-1/m-p/824735#M100447</guid>
      <dc:creator>Jed_Campbell</dc:creator>
      <dc:date>2024-12-20T20:32:15Z</dc:date>
    </item>
  </channel>
</rss>

