<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; Stored Procedures</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/stored-procedures/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Wed, 19 Jun 2013 16:15:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Stored procedures</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/stored-procedures-2/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/stored-procedures-2/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 06:33:00 +0000</pubDate>
		<dc:creator>ravula</dc:creator>
				<category><![CDATA[SQL statement]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/stored-procedures-2/</guid>
		<description><![CDATA[New Discussion Post by ToddN2000]]></description>
				<content:encoded><![CDATA[New Discussion Post by ToddN2000]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/stored-procedures-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SQL server</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-srever/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sql-srever/#comments</comments>
		<pubDate>Thu, 14 Jun 2012 11:11:38 +0000</pubDate>
		<dc:creator>Pannudeshmukh</dc:creator>
				<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[i want to copy  the store peocedure from one database to another . iam using sql2005]]></description>
				<content:encoded><![CDATA[<p>i want to copy  the store peocedure from one database to another . iam using sql2005</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sql-srever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Help</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-help/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-help/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 20:36:03 +0000</pubDate>
		<dc:creator>Cdizl</dc:creator>
				<category><![CDATA[INSERT SELECT statement]]></category>
		<category><![CDATA[SQL Records]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server administration]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi all, I am running into a little bit of a problem. I need to insert records with a stored procedure into a table based on the information selected. From the info selected, it decides what table to insert it into.  Example: Select top 1 SerialNo from dbo.Serial &#8211;returns &#8216;ASEEADL1234567&#8242; based on the 8th letter [...]]]></description>
				<content:encoded><![CDATA[<p>Hi all,</p>
<div></div>
<div>I am running into a little bit of a problem. I need to insert records with a stored procedure into a table based on the information selected. From the info selected, it decides what table to insert it into. </div>
<div></div>
<div>Example:</div>
<div></div>
<div>Select top 1 SerialNo from dbo.Serial</div>
<div>&#8211;returns &#8216;ASEEADL1234567&#8242;</div>
<div></div>
<div>based on the 8th letter from the end</div>
<div>so substring(reverse(SerialNo),8,1) = &#8216;L&#8217;</div>
<div></div>
<div>so based on L, i need it to look into another table called SerialMfgYear, and based on if it is equal to L, then it inserts into the table that equals the value in the column SerialTableName.</div>
<div></div>
<div>SerialMfgYear		SerialTableName</div>
<div>	L				Serial2010</div>
<div></div>
<div></div>
<div>so i need it to select the letter out of the select first and dynamically insert into correct table based on that letter.</div>
<div></div>
<div>I would like to run it on the whole database via a select * from dbo.Serial and then insert each row into the correct table.</div>
<div></div>
<div>I have a working way with cursor and a while loop but these are way too time consuming and don&#8217;t seem to be the correct way to get this done.</div>
<div></div>
<div>Example of while loop:</div>
<div></div>
<div>
<div>create procedure test1        </div>
<div>as        </div>
<div>begin     </div>
<div>	set nocount on      </div>
<div>	declare @i int &#8211;iterator      </div>
<div>	declare @iRwCnt int &#8211;rowcount      </div>
<div>	 </div>
<div>	set @i = 0 &#8211;initialize  </div>
<div>	  </div>
<div>	 </div>
<div>	create table #tempSerial(ID int identity(1,1), Value varchar(20))    </div>
<div>	  </div>
<div>	insert into #tempSerial(Value)      </div>
<div>	select top 100 SerialNo      </div>
<div>	from dbo.Serial       </div>
<div>	where substring(SerialNo, 1, 1) != &#8216;B&#8217;    </div>
<div>	and substring(reverse(SerialNo), 8, 1) between (select top 1 	SerialMfgYear from dbo.SerialMfgYear order by SerialMfgYear)       </div>
<div>	and (select top 1 SerialMfgYear from dbo.SerialMfgYear order by 	SerialMfgYear desc)      </div>
<div>	</div>
<div>	set @iRwCnt = @@ROWCOUNT      </div>
<div></div>
<div>	create clustered index idx_tmp on #tempSerial(ID) WITH 	FILLFACTOR = 100</div>
<div>	 </div>
<div>	declare @input as varchar(20)      </div>
<div>	declare @year as varchar(1)        </div>
<div>	declare @table as varchar(15)      </div>
<div>	declare @sql as nvarchar(250)     </div>
<div>	while @i &lt;= @iRwCnt      </div>
<div>	begin    </div>
<div>		set @i = @i + 1       </div>
<div>		select @input = Value from #tempSerial where ID = @i      </div>
<div></div>
<div>		set @year = substring(reverse(@input), 8, 1)        </div>
<div>		set @table = (select SerialTableName from 			dbo.SerialMfgYear where SerialMfgYear = @year)        </div>
<div>		  </div>
<div>		select @sql = &#8216;insert into &#8216; + @table + &#8216; select * from 		dbo.Serial       </div>
<div>		where @SerialNo not in (select SerialNo from &#8216; + @table +&#8217;) 		AND SerialNo = @SerialNo&#8217;        </div>
<div>		EXEC sp_executesql @sql, N&#8217;@SerialNo nvarchar(15)&#8217;, 		@SerialNo = @input       </div>
<div>	end      </div>
<div>	drop table #tempSerial      </div>
<div>end </div>
</div>
<div></div>
<div>i am stuck <img src='http://itknowledgeexchange.techtarget.com/itanswers/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </div>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/sql-server-help/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Stored Procedure and crystal reports resources</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/store-proc-and-crystal-reports/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/store-proc-and-crystal-reports/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 17:41:16 +0000</pubDate>
		<dc:creator>Khanhhoa</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[Crystal Reports Stored Procedures]]></category>
		<category><![CDATA[IT Books]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Can anyone please tell me where to buy store procedure and crystal reports book in one.  Thanks.]]></description>
				<content:encoded><![CDATA[<p>Can anyone please tell me where to buy store procedure and crystal reports book in one.  Thanks.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/store-proc-and-crystal-reports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Validating Active Directory login from within a stored-procedure</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/validating-active-directory-login-from-within-a-stored-procedure/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/validating-active-directory-login-from-within-a-stored-procedure/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 15:14:07 +0000</pubDate>
		<dc:creator>Joetig</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Active Directory security]]></category>
		<category><![CDATA[CLR Active Directory]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I have an application that needs to use active directory to ensure user login is valid. The issue is that the machine is in a different domain than our AD server. I am looking at creating a clr procedure on the SQL server that is in the same domain. Then from the application execute a procedure [...]]]></description>
				<content:encoded><![CDATA[<p>I have an application that needs to use active directory to ensure user login is valid. The issue is that the machine is in a different domain than our AD server. I am looking at creating a clr procedure on the SQL server that is in the same domain. Then from the application execute a procedure from the sql server that is in not in the AD, this procedure will call the procedure that will house the clr function. It would pass credentials to attempt to login and return success or fail. Having issues installing the CLR code.<br/><br/>  Any ideas would be appreciated.<br/><br/>  <br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/validating-active-directory-login-from-within-a-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Modifying a Stored Procedure</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/modifying-a-stored-procedure/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/modifying-a-stored-procedure/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 14:31:51 +0000</pubDate>
		<dc:creator>DJandLO</dc:creator>
				<category><![CDATA[Crystal Reports]]></category>
		<category><![CDATA[SELECT statement]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Database]]></category>
		<category><![CDATA[SQL stored procedures]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The stored procedure below pulls suspected duplicate records. What I need it to do is return suspected duplicates only if it meets the criteria of having a member record type (GEN) &#038; a non-member record type (WEB). But if the duplicates both have a non-member record type I don&#8217;t want it showing up on the [...]]]></description>
				<content:encoded><![CDATA[<p>The stored procedure below pulls suspected duplicate records. What I need it to do is return suspected duplicates only if it meets the criteria of having a member record type (GEN) &#038; a non-member record type (WEB). But if the duplicates both have a non-member record type I don&#8217;t want it showing up on the report. <br/><br/> set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo]. AS BEGIN SELECT N.ID, N.LAST_NAME, N.FIRST_NAME, NA.ADDRESS_1, NA.ADDRESS_2, NA.CITY, NA.STATE_PROVINCE, NA.ZIP, NA.COUNTRY, N.MEMBER_TYPE FROM NAME N, NAME_ADDRESS NA, ( SELECT LAST_NAME, STATE_PROVINCE, COUNTRY, COUNT(1) COUNT1 FROM NAME WHERE LAST_NAME &lt;&gt; ” AND STATE_PROVINCE &lt;&gt; ” GROUP BY LAST_NAME, STATE_PROVINCE, COUNTRY HAVING COUNT(1) &gt; 1) T WHERE T.LAST_NAME = N.LAST_NAME AND T.STATE_PROVINCE = NA.STATE_PROVINCE AND T.STATE_PROVINCE = N.STATE_PROVINCE AND T.COUNTRY = NA.COUNTRY AND N.ID = NA.ID AND N.MAIL_ADDRESS_NUM = NA.ADDRESS_NUM – AND T.LAST_NAME = ‘HARRISON’ ORDER BY N.LAST_NAME, N.STATE_PROVINCE, N.COUNTRY END <br/><br/> Thanks, DJ<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/modifying-a-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Related to SQL server 2005</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/related-to-sql-server-2005/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/related-to-sql-server-2005/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 04:39:20 +0000</pubDate>
		<dc:creator>ITIndustry</dc:creator>
				<category><![CDATA[Decryption]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL stored procedures]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[When we write store procedure it is encrypt by &#8211;with encrypt tag means it will locked it doesn&#8217;t show sp so how it will be DECRYPT?]]></description>
				<content:encoded><![CDATA[<p>When we write store procedure it is encrypt by &#8211;with encrypt  tag means it will locked it doesn&#8217;t show sp so how it will be DECRYPT?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/related-to-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t close or clear file in iSeries V5R3</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cursor-stuck-open-cant-close-file-cant-clear/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/cursor-stuck-open-cant-close-file-cant-clear/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 19:09:38 +0000</pubDate>
		<dc:creator>ItsHer</dc:creator>
				<category><![CDATA[iSeries]]></category>
		<category><![CDATA[Stored Procedures]]></category>
		<category><![CDATA[V5R3]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Generally we create a file in QTemp when returning data for a stored procedure. The cursor is left open so the data can be accessed. I neglected to copy the file to qtemp and now on our test system, I can&#8217;t close the file, I can&#8217;t clear the file. I&#8217;ve deleted each of the records [...]]]></description>
				<content:encoded><![CDATA[<p>Generally we create a file in QTemp when returning data for a stored procedure. The cursor is left open so the data can be accessed. I neglected to copy the file to qtemp and now on our test system, I can&#8217;t close the file, I can&#8217;t clear the file. I&#8217;ve deleted each of the records in the file manually, however I am concerned the status of &#8216;file in use&#8217; will cause problems. How can I get the file closed?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/cursor-stuck-open-cant-close-file-cant-clear/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Thousands and thousands of simultaneous users hitting a sproc &#8212; what do you do?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/thousands-and-thousands-of-simultaneous-users-hitting-a-sproc-what-do-you-do/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/thousands-and-thousands-of-simultaneous-users-hitting-a-sproc-what-do-you-do/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 00:14:12 +0000</pubDate>
		<dc:creator>Oscarius</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server stored procedures]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[folks, i am not a db guy altogether, but I am a developer, and someone had asked me that question, and i got interested in the resolution. Lets say you have 50K users that hit the same stored procedure at the same time. The stored procedure is computation intensive and goes out to lunch for [...]]]></description>
				<content:encoded><![CDATA[<p>folks, i am not a db guy altogether, but I am a developer, and someone had asked me that question, and i got interested in the resolution. Lets say you have 50K users that hit the same stored procedure at the same time. The stored procedure is computation intensive and goes out to lunch for a bunch of seconds for each caller. Am i correct in thinking that the sql server has a certain number of threads that these calls to the sproc are made on &#8212; so if the thread pool size is 100 threads, it means the first 100 callers are entering the procedure, and the rest are blocking? for the sake of argument, lets say there are no record locks inside that sproc &#8212; its all complicated joins and calculations &#8212; what can be done in this case? as a developer, i started thinking that perhaps i should have multiple copies of that database so that i can partition the incoming callers in some round robin fashion? but even if i have 100 databases that are all copies of each other, the number of users/callers is still by far larger than the number of threads available to do the work? From all the reading i have done, the suggestions seem to be of &#8220;tuning&#8221; nature &#8212; meaning i can improve this or that &#8212; but what i need is something &#8220;architectural&#8221; that will show me how to truly scale databases. For example, calling .NET dlls from the sproc will dramatically improve the performance &#8212; but what if the number of users goes up to 100K? 500K? Any white papers, books you can suggest? i am truly looking for the way the &#8220;big boys&#8221; do it &#8212; i need to know that as the number of users goes up and up, i can spend the money, buy new servers, do some DB magic and have a truly scalable solution. thank you<br/><br/> Oh, one more thing.   As a possible solution, i was told that these guys have multiple versions of the same sproc, but under different names and somehow this makes the situation more scalable &#8212; does this make any sense?<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/thousands-and-thousands-of-simultaneous-users-hitting-a-sproc-what-do-you-do/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to populate datagrid using store procedure</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-populate-datagrid-using-store-procedure/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/how-to-populate-datagrid-using-store-procedure/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 22:20:09 +0000</pubDate>
		<dc:creator>Implicitcherry</dc:creator>
				<category><![CDATA[DataGridView]]></category>
		<category><![CDATA[Stored Procedures]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Visual Basic developers]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[m trying to populate a datagridview using a store procedure called from  a module but it is givign me some problem as in my module i use the Function as a bindingsource can someone help me here im totally lost]]></description>
				<content:encoded><![CDATA[<p>m trying to populate a datagridview using a store procedure called from  a module but it is givign me some problem as in my module i use the Function as a bindingsource can someone help me here im totally lost</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/how-to-populate-datagrid-using-store-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/23 queries in 0.033 seconds using memcached
Object Caching 925/1024 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-19 16:52:16 -->