<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Database Integration</title><link>https://www.infopathdev.com:443/forums/47.aspx</link><description>For questions concerning issues in the integration of SQL and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/76562.aspx</link><pubDate>Sun, 18 Mar 2012 04:39:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:76562</guid><dc:creator>EmmaRoberts</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/76562.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=76562</wfw:commentRss><description>I won&amp;#39;t suggest returning any results from the trigger unless you are ok with making changes to the code when the feature is deprecated. as per the BOL the option will be deprecated in the future versions.</description></item><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71866.aspx</link><pubDate>Tue, 08 Nov 2011 15:57:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71866</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71866.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71866</wfw:commentRss><description>Hey, great, and thanks for the update!</description></item><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71865.aspx</link><pubDate>Tue, 08 Nov 2011 15:50:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71865</guid><dc:creator>tps14334</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71865.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71865</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;After seeing mention of it on the blog post you provided, I half heartly tried it last Thursday to no avail. But it was late in the day and I was ready to get out for a three day weekend. &lt;/p&gt;&lt;p&gt;&amp;nbsp;Fast forward to today, I tinkered around a little more and it looks like I finally got it working! Below is the updated Store Proc that I finally got to work:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;USE [WDIS];&lt;br /&gt;GO&lt;br /&gt;SET ANSI_NULLS ON;&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER ON;&lt;br /&gt;GO&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;GO&lt;br /&gt;Set IMPLICIT_TRANSACTIONS OFF&lt;br /&gt;GO&lt;br /&gt;ALTER PROCEDURE [dbo].[INSERT_MACRO_DSX_ORDER_CLOSER]&lt;br /&gt;@FORM_JOB_NUM varchar(6), @FORM_REP_NAME varchar(50)&lt;br /&gt;WITH EXEC AS CALLER&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;INSERT INTO WDIS.MACRO.DSX_ORDER_CLOSER (FORM_JOB_NUM, FORM_REP_NAME) VALUES (@FORM_JOB_NUM, @FORM_REP_NAME)&lt;br /&gt;COMMIT&lt;br /&gt;END&lt;br /&gt;GO &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71747.aspx</link><pubDate>Fri, 04 Nov 2011 00:16:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71747</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71747.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71747</wfw:commentRss><description>&lt;p&gt;And is implicit_transactions set to off in your stored proc?&lt;/p&gt;</description></item><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71745.aspx</link><pubDate>Thu, 03 Nov 2011 23:14:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71745</guid><dc:creator>tps14334</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71745.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71745</wfw:commentRss><description>Correct, when calling the proc from the code above the data is not written to the table, bit it does trigger the identity trigger to increment. When I call the proc from a SQL editor, the data is written and the identity increments just like it should, using the exact same command.

InfoPath 2010, don&amp;#39;t think it is SP&amp;#39;d yet.</description></item><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71744.aspx</link><pubDate>Thu, 03 Nov 2011 23:01:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71744</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71744.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71744</wfw:commentRss><description>&lt;p&gt;So, I guess I&amp;#39;m having trouble understanding your question.&lt;/p&gt;
&lt;p&gt;Is the stored procedure, when executed from you code in InfoPath, &lt;em&gt;not&lt;/em&gt; inserting data into your database?&lt;/p&gt;
&lt;p&gt;If that is the case, what version of InfoPath (including service pack) are you using?&lt;/p&gt;</description></item><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71739.aspx</link><pubDate>Thu, 03 Nov 2011 21:35:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71739</guid><dc:creator>tps14334</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71739.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71739</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Interesting read, but not exactly what I am looking for (I think). The form it self has no bearing on what ID number is used or if used at all. I am looking for the form to insert two fields into the table, and let the table&amp;#39;s Identity feature make the unique key for the row. An application using the data inserted later will care about the ID, just need the form to hand over those two items.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thank you for the quick response by the way. Still look forward to some insightful information. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71738.aspx</link><pubDate>Thu, 03 Nov 2011 21:20:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71738</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71738.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71738</wfw:commentRss><description>&lt;p&gt;The missing ID numbers are standard InfoPath behavior, believe it or not. I mention it at the end of &lt;a href="http://www.infopathdev.com/blogs/hilary/archive/2008/11/21/fun-with-sequential-form-ids-sql-and-sprocs.aspx"&gt;this&lt;/a&gt; blog post. You&amp;#39;ll find more info &lt;a href="http://www.eggheadcafe.com/microsoft/InfoPath/31137951/secondary-data-connection-gets-queried-twice.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But I wonder if I&amp;#39;m not reading your right - is your command actually failing to execute from InfoPath? That is, you aren&amp;#39;t getting data in the table at all from this? In that case, again at the end of my blog post, Jimmy had mentioned that setting implicit_transactions to off inside the stored procedure allowed InfoPath to execute it.&lt;/p&gt;</description></item><item><title>Insert Stored Proc + Button Code = Triggered Identity, But No Record</title><link>https://www.infopathdev.com:443/forums/thread/71737.aspx</link><pubDate>Thu, 03 Nov 2011 21:08:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71737</guid><dc:creator>tps14334</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71737.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=71737</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Venturing into the realm of InfoPath to create a form which will be published to a SharePoint site. I have gone through a lot of learning of creating the form, using secondary connections and filtering its data, and just trying to be able to find a way for the form to dump the information into a SQL table. Probing around I found a solution which is suppose to work, by using a stored procedure to perform the insert and passing through the variables when called for by some button code (found here: http://www.bizsupportonline.net/infopath2007/use-receive-data-connection-execute-sql-server-stored-procedure.htm).&lt;/p&gt;&lt;p&gt;&amp;nbsp;The issue I am having with this solution is that it will trigger the Identity function on a ID column and make the table increment by one, but will not actually insert the record into the table.&amp;nbsp; When I manually call for the Stored Proc passing through the variables, the table captures the data and the tigger increments again just fine. You can see the gap of the &amp;quot;phantom&amp;quot; record from the form in the identity column: 1, 2, 4.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I have tried using simple execute commands, to more involved commands trying to get the new data to stick in the table to no avail. If anyone can offer some advice on the issue, I would greatly appreciate it.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;Stored Proceedure:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;ALTER PROCEDURE [dbo].[INSERT_MACRO_DSX_ORDER_CLOSER]&lt;br /&gt;@FORM_JOB_NUM varchar(6), @FORM_REP_NAME varchar(50)&lt;br /&gt;WITH EXEC AS CALLER&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;INSERT INTO WDIS.MACRO.DSX_ORDER_CLOSER (FORM_JOB_NUM, FORM_REP_NAME) VALUES (@FORM_JOB_NUM, @FORM_REP_NAME)&lt;br /&gt;END&lt;/p&gt;&lt;p&gt;&lt;b&gt;Button Code:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;#39; Retrieve the name of the Office application to add to the database table&lt;br /&gt;Dim dom As XPathNavigator = MainDataSource.CreateNavigator()&lt;br /&gt;&lt;br /&gt;Dim parmJobNum As String = dom.SelectSingleNode( _&lt;br /&gt;&amp;quot;//my:txtJobNumber&amp;quot;, NamespaceManager).Value&lt;br /&gt;&lt;br /&gt;Dim parmRepName As String = dom.SelectSingleNode( _&lt;br /&gt;&amp;quot;//my:txtRepName&amp;quot;, NamespaceManager).Value&lt;br /&gt;&lt;br /&gt;&amp;#39; Retrieve the connection to the database table&lt;br /&gt;Dim connection As AdoQueryConnection = DataConnections(&amp;quot;DSX_ORDER_CLOSER&amp;quot;)&lt;br /&gt;&lt;br /&gt;&amp;#39; Save the original statement that is stored in the Command property&lt;br /&gt;Dim originalCommand As String = connection.Command&lt;br /&gt;&lt;br /&gt;&amp;#39; Execute the stored procedure&lt;br /&gt;connection.Command = &amp;quot;BEGIN TRANSACTION DECLARE @FORM_JOB_NUM varchar(6), @FORM_REP_NAME varchar(50) EXEC [dbo].[INSERT_MACRO_DSX_ORDER_CLOSER] @FORM_JOB_NUM = &amp;#39;&amp;quot; &amp;amp; parmJobNum &amp;amp; &amp;quot;&amp;#39;, @FORM_REP_NAME = &amp;#39;&amp;quot; &amp;amp; parmRepName &amp;amp; &amp;quot;&amp;#39;&amp;nbsp; COMMIT TRANSACTION&amp;nbsp; &amp;quot;&lt;br /&gt;connection.Execute()&lt;br /&gt;&lt;br /&gt;&amp;#39; Restore the statement of the Command property to its original value&lt;br /&gt;connection.Command = originalCommand &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>