<?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 writing data through stored procedure in QS in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/writing-data-through-stored-procedure-in-QS/m-p/1696645#M53291</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have two questions about stored procedures. Its my first time calling a Stored procedure from QS. I have set it up in SQLMS and tested it in the server. it works fine.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The stored Prcodure is used to inset data into the table. I call it from QS as follows:&lt;/P&gt;&lt;P&gt;SQL exec dbo.testSP(5);&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR //tried both ways still getting the same error.&lt;/P&gt;&lt;P&gt;SQL exec "DBName".dbo.testSP(5);&amp;nbsp;&lt;/P&gt;&lt;P&gt;My SP accepts a parameter of type int and is defined as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Create PROCEDURE [dbo].[testSP]
	@SN int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    insert into dbo.test([Sort Number])
	Values(@SN)

END&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i run this from QS, i get the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.JPG" style="width: 531px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32448i83CA2A81AF01FF34/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.JPG" alt="error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could someone please tell me what im missing so i can fix it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have a table (lets call it Table A) in QS with few rows, is it possible to insert all the rows in Table A to a table in SQLMS using a stored procedure?&lt;/P&gt;&lt;P&gt;how do you reference the values in the table? if someone could provide me with an example, i'd really really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Waleed&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:35:35 GMT</pubDate>
    <dc:creator>waleeed_mahmood</dc:creator>
    <dc:date>2024-11-16T02:35:35Z</dc:date>
    <item>
      <title>writing data through stored procedure in QS</title>
      <link>https://community.qlik.com/t5/App-Development/writing-data-through-stored-procedure-in-QS/m-p/1696645#M53291</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have two questions about stored procedures. Its my first time calling a Stored procedure from QS. I have set it up in SQLMS and tested it in the server. it works fine.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The stored Prcodure is used to inset data into the table. I call it from QS as follows:&lt;/P&gt;&lt;P&gt;SQL exec dbo.testSP(5);&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR //tried both ways still getting the same error.&lt;/P&gt;&lt;P&gt;SQL exec "DBName".dbo.testSP(5);&amp;nbsp;&lt;/P&gt;&lt;P&gt;My SP accepts a parameter of type int and is defined as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Create PROCEDURE [dbo].[testSP]
	@SN int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    insert into dbo.test([Sort Number])
	Values(@SN)

END&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i run this from QS, i get the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.JPG" style="width: 531px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32448i83CA2A81AF01FF34/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.JPG" alt="error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could someone please tell me what im missing so i can fix it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have a table (lets call it Table A) in QS with few rows, is it possible to insert all the rows in Table A to a table in SQLMS using a stored procedure?&lt;/P&gt;&lt;P&gt;how do you reference the values in the table? if someone could provide me with an example, i'd really really appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Waleed&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:35:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/writing-data-through-stored-procedure-in-QS/m-p/1696645#M53291</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2024-11-16T02:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: writing data through stored procedure in QS</title>
      <link>https://community.qlik.com/t5/App-Development/writing-data-through-stored-procedure-in-QS/m-p/1696714#M53295</link>
      <description>&lt;P&gt;For those wondering for the solution to the first question, the brackets are [] and not (). It worked for me. If someone could please shed some light on the second question, id really appreciate it.&lt;/P&gt;&lt;P&gt;i thought of using loops but loops in QS can be really slow. so is there a faster way?&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 17:38:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/writing-data-through-stored-procedure-in-QS/m-p/1696714#M53295</guid>
      <dc:creator>waleeed_mahmood</dc:creator>
      <dc:date>2020-04-25T17:38:47Z</dc:date>
    </item>
  </channel>
</rss>

