<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Alternate Fix : ERROR 1222 : Lock request time out period exceeded</title>
	<atom:link href="http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Wed, 22 May 2013 19:03:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Mehboob Ali Khan</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-445892</link>
		<dc:creator><![CDATA[Mehboob Ali Khan]]></dc:creator>
		<pubDate>Thu, 28 Mar 2013 10:51:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-445892</guid>
		<description><![CDATA[Restart the service solve my problem.]]></description>
		<content:encoded><![CDATA[<p>Restart the service solve my problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pradip</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-414001</link>
		<dc:creator><![CDATA[Pradip]]></dc:creator>
		<pubDate>Mon, 28 Jan 2013 07:28:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-414001</guid>
		<description><![CDATA[Hi , Rollback tran worked!!!]]></description>
		<content:encoded><![CDATA[<p>Hi , Rollback tran worked!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rama Chandra</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-402761</link>
		<dc:creator><![CDATA[Rama Chandra]]></dc:creator>
		<pubDate>Wed, 02 Jan 2013 13:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-402761</guid>
		<description><![CDATA[This query helps u definetly. 

Just kill the process that locked the database object by using 

--Kill @SpId

select 
distinct object_name(a.rsc_objid), a.req_spid, b.loginame
from master.dbo.syslockinfo a (nolock) join
master.dbo.sysprocesses b (nolock) on a.req_spid=b.spid
where object_name(a.rsc_objid) is not null
ORDER BY object_name(a.rsc_objid)

EX:- Kill (req_spid)]]></description>
		<content:encoded><![CDATA[<p>This query helps u definetly. </p>
<p>Just kill the process that locked the database object by using </p>
<p>&#8211;Kill @SpId</p>
<p>select<br />
distinct object_name(a.rsc_objid), a.req_spid, b.loginame<br />
from master.dbo.syslockinfo a (nolock) join<br />
master.dbo.sysprocesses b (nolock) on a.req_spid=b.spid<br />
where object_name(a.rsc_objid) is not null<br />
ORDER BY object_name(a.rsc_objid)</p>
<p>EX:- Kill (req_spid)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wallace</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-381354</link>
		<dc:creator><![CDATA[Wallace]]></dc:creator>
		<pubDate>Mon, 26 Nov 2012 14:23:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-381354</guid>
		<description><![CDATA[Pinal Dave, I get this error when trying to expand the Temporary Tables in TempDB using SSMS.  I was researching the reason why Who_is was showing I had a process blocked by TempDB (the only process I was running was Who_IS).  We have been having timeout errors recently from applications which call stored procs, but this error number was not listed on those errors.  
Any ideas?]]></description>
		<content:encoded><![CDATA[<p>Pinal Dave, I get this error when trying to expand the Temporary Tables in TempDB using SSMS.  I was researching the reason why Who_is was showing I had a process blocked by TempDB (the only process I was running was Who_IS).  We have been having timeout errors recently from applications which call stored procs, but this error number was not listed on those errors.<br />
Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abhIShek BandI</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-327745</link>
		<dc:creator><![CDATA[abhIShek BandI]]></dc:creator>
		<pubDate>Thu, 09 Aug 2012 14:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-327745</guid>
		<description><![CDATA[@Spade

What are those objid&#039;s means
1-
2-
3-

select OBJECT_NAME(1),OBJECT_NAME(2),OBJECT_NAME(3)
for objectid 3 am getting-sysrscols
wat abt 1 and 2?]]></description>
		<content:encoded><![CDATA[<p>@Spade</p>
<p>What are those objid&#8217;s means<br />
1-<br />
2-<br />
3-</p>
<p>select OBJECT_NAME(1),OBJECT_NAME(2),OBJECT_NAME(3)<br />
for objectid 3 am getting-sysrscols<br />
wat abt 1 and 2?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kuldeep singh</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-321649</link>
		<dc:creator><![CDATA[kuldeep singh]]></dc:creator>
		<pubDate>Mon, 30 Jul 2012 06:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-321649</guid>
		<description><![CDATA[hi sir i like your Blog .it is very KnowledgeStormful.
but sir iam geeting error on update record:

Error 50013, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage. 

My procedure is:
--payManualAttProc &#039;13800&#039;,&#039;2012/07/28&#039;,&#039;PL&#039;,&#039;PL&#039;,&#039;&#039;,&#039;INT01&#039;                   
CREATE proc [dbo].payManualAttProc            
@empcode varchar(5),                  
@dt varchar(10),                  
@statdis varchar(15),                  
@stat1dis varchar(15),                  
@user varchar(6),                  
@comp varchar(5)                  
                
As                  
-- exec payManualAttProc &#039;10057&#039;,&#039;2010/02/02&#039;,&#039;PL&#039;,&#039;PL&#039;,&#039;&#039;,&#039;INT01&#039;                   
declare @i int,@j int,@lcode varchar(15),@stat1 char(1),@stat2 char(2),@pin int,@maxno int,@lform varchar(15),@holi varchar(15)                  
select @i = 0                  
select @j = 0                  
                  
If @statdis = &#039;Present&#039;                   
begin                  
    select @stat1 = &#039;P&#039;                  
    select @i = 0                  
end                  
Else If @statdis = &#039;RL&#039;                   
begin                  
    select @stat1 = &#039;P&#039;                  
    select @lcode = &#039;INT01RIL001&#039;                  
    select @i = 1                  
end                  
Else If @statdis = &#039;Absent&#039;                   
begin                  
    select @stat1 = &#039;A&#039;                  
    select @i = 0                  
end                  
Else If @statdis = &#039;PL&#039;                   
begin                  
    select @stat1 = &#039;E&#039;                  
    select @lcode = &#039;INT01EAR001&#039;                  
    select @i= 1                  
end                  
Else If @statdis = &#039;ML&#039;                   
begin                  
    select @stat1 = &#039;F&#039;                  
    select @lcode = &#039;INT01MAT001&#039;                  
    select @i= 1                  
end                  
Else If @statdis = &#039;LWP&#039;                   
begin                  
    select @stat1 = &#039;L&#039;                  
    select @lcode = &#039;INT01LWP001&#039;                  
    select @i= 1                  
end                  
Else If @statdis = &#039;CL&#039;                   
begin                  
    select @stat1 = &#039;C&#039;                  
    select @lcode = &#039;INT01CAS001&#039;                  
    select @i= 1                  
end                  
Else If @statdis = &#039;SL&#039;                   
begin                  
    select @stat1 = &#039;S&#039;                  
    select @lcode = &#039;INT01SHO001&#039;                  
    select @i= 2                  
end                  
Else If @statdis = &#039;Late&#039;                   
begin                  
    select @stat1 = &#039;T&#039;                  
end                  
Else If @statdis = &#039;Out Duty&#039;                   
begin                  
    select @stat1 = &#039;O&#039;                  
    select @lcode = &#039;INT01ODD001&#039;                  
    select @i= 2                  
end                  
Else If @statdis = &#039;Tour&#039;                   
begin                  
    select @stat1 = &#039;R&#039;                  
    select @lcode = &#039;INT01TOU001&#039;                  
    select @i= 1                  
end                  
Else If @statdis = &#039;SICK&#039;                   
begin                  
    select @stat1 = &#039;K&#039;                  
    select @lcode = &#039;INT01SIC001&#039;                  
    select @i= 2                  
end                  
Else If @statdis = &#039;1/2 CL&#039;                   
begin                  
    select @stat1 = &#039;Y&#039;                  
    select @lcode = &#039;INT01SUN014&#039;                  
    select @i= 2                  
end                  
Else If @statdis = &#039;Compensation&#039;                   
begin                  
    select @stat1 = &#039;M&#039;                  
    select @lcode = &#039;INT01COM001&#039;                  
    select @i= 2                  
end                  
Else                  
begin                  
    select @stat1 = &#039;&#039;                  
    select @lcode = &#039;&#039;                  
    select @i= 0                  
End                   
                  
If @stat1dis = &#039;Present&#039;                   
begin                  
    select @stat2 = &#039;P&#039;                  
    select @j = 0                  
end                  
Else If @stat1dis = &#039;RL&#039;                   
begin                  
    select @stat2 = &#039;P&#039;                  
    select @lcode = &#039;INT01RIL001&#039;                  
end                  
Else If @stat1dis = &#039;Absent&#039;                   
begin                  
    select @stat2 = &#039;A&#039;                  
end                  
Else If @stat1dis = &#039;PL&#039;                   
begin            
    select @stat2 = &#039;E&#039;                  
    select @lcode = &#039;INT01EAR001&#039;                  
end                  
Else If @stat1dis = &#039;ML&#039;                   
begin                  
    select @stat2 = &#039;F&#039;                  
    select @lcode = &#039;INT01MAT001&#039;                  
end                  
Else If @stat1dis = &#039;LWP&#039;                   
begin                  
    select @stat2 = &#039;L&#039;                  
    select @lcode = &#039;INT01LWP001&#039;                  
end                  
Else If @stat1dis = &#039;CL&#039;                   
begin                  
    select @stat2 = &#039;C&#039;                  
    select @lcode = &#039;INT01CAS001&#039;                  
end                  
Else If @stat1dis = &#039;SL&#039;                   
begin                  
    select @stat2 = &#039;S&#039;                  
    select @lcode = &#039;INT01SHO001&#039;                  
    select @j = 3                  
end                  
Else If @stat1dis = &#039;Late&#039;                   
begin                  
    select @stat2 = &#039;T&#039;                  
end                  
Else If @stat1dis = &#039;Out Duty&#039;                   
begin                  
    select @stat2 = &#039;O&#039;                  
    select @lcode = &#039;INT01ODD001&#039;                  
    select @j = 3                  
end                  
Else If @stat1dis = &#039;Tour&#039;                   
begin                  
    select @stat2 = &#039;R&#039;          
    select @lcode = &#039;INT01TOU001&#039;                 
end                  
Else If @stat1dis = &#039;SICK&#039;                   
begin                  
    select @stat2 = &#039;K&#039;                  
    select @lcode = &#039;INT01SIC001&#039;                  
    select @j = 3                  
end                  
Else If @stat1dis = &#039;1/2 CL&#039;                   
begin                  
    select @stat2 = &#039;Y&#039;                  
    select @lcode = &#039;INT01SUN014&#039;                  
   select @j = 3                  
end                  
Else If @stat1dis = &#039;Compensation&#039;                   
begin                  
    select @stat2 = &#039;M&#039;                  
    select @lcode = &#039;INT01COM001&#039;                  
    select @j = 3                  
end                  
Else                  
begin                  
    select @stat2 = &#039;&#039;                  
    select @lcode = &#039;&#039;                  
End                   
                  
If datename(dw,@dt) = &#039;Sunday&#039;                   
 select @holi = &#039;INT01SUN001&#039;                  
else                   
 select @holi = &#039;&#039;                  
                  
                     
If @stat1 = &#039;P&#039; And @stat2 = &#039;P&#039; And @stat1dis = &#039;Present&#039;                  
    select @lcode = &#039;&#039;                  
                  
If @i = 1 Or @i + @j = 5                   
    select @pin = 1                  
Else                  
    select @pin = @i + @j                  
                      
                  
 if exists (select * from pay_leave_form_tmp where emp_code=@empcode and convert(varchar,date_from,111)=@dt and l_city=&#039;P&#039;)          
   BEGIN     
     
      raiserror (&#039;Leave already pending for approval this date. Updates for this date aborted&#039;,10,1)     
       
      END        
            
     If @pin &gt; 0                   
  begin                  
            select @maxNo=max(convert(int , right(leave_form_code,6))) from pay_leave_form where left(leave_form_code,5) = @comp                  
            select @lform = @comp + replicate(&#039;0&#039;,6-len(@maxno))+ ltrim(str(@maxno+1))                   
                
--select * from master.dbo.sysmessages where error &gt; 50000                
                
---select * from pay_leave_form where emp_code=&#039;10057&#039;                
            insert into pay_leave_form(emp_code,leave_form_code,leave_code,date_from,date_to,no_of_days,l_address1,l_address2,l_address3,                
                                        l_city,l_pin,created_by,created_on,last_touch_by,last_touch_on,holiday)                
            values(@empcode,@lform,@lcode,@dt,@dt,1,&#039;&#039;,&#039;&#039;,&#039;Entry by Personal&#039;,&#039;&#039;,@pin,@user,getdate(),@user,getdate(),0)                  
                
     End                  
--     select * from pay_attendence  where emp_code = @empcode and month(date) =&#039; &amp; Mid(mskdate.Text, 4, 2) &amp; &#039; and year(date) = &#039; &amp; Right(mskdate.Text, 4), con, adOpenForwardOnly, adLockReadOnly                  
                  
 If @stat1  &#039;&#039; Or @stat2  &#039;&#039;                   
 begin                  
  if exists (select * from pay_attendence where emp_code=@empcode and convert(varchar,date,111)=@dt )                  
   begin                  
    update pay_attendence set status = @stat1, status1 =@stat2, leave_code =@lcode ,holiday_code =@holi,                  
    last_touch_by = @user, last_touch_on = getdate() where emp_code = @empcode and convert(varchar,date,111) =@dt                  
  end                  
  else                  
  begin                  
   insert into pay_attendence ( emp_code , date ,incomingtime, outgoingtime ,status , status1 ,leave_code,holiday_code,created_by,                   
       created_on ,last_touch_by, last_touch_on)                   
   values (@empcode,@dt,@dt,@dt,@stat1 ,@stat2,&#039;&#039;,@holi,@user,getdate(),@user,getdate())                  
  End                   
  end]]></description>
		<content:encoded><![CDATA[<p>hi sir i like your Blog .it is very KnowledgeStormful.<br />
but sir iam geeting error on update record:</p>
<p>Error 50013, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage. </p>
<p>My procedure is:<br />
&#8211;payManualAttProc &#8217;13800&#8242;,&#8217;2012/07/28&#8242;,&#8217;PL&#8217;,'PL&#8217;,&#8221;,&#8217;INT01&#8242;<br />
CREATE proc [dbo].payManualAttProc<br />
@empcode varchar(5),<br />
@dt varchar(10),<br />
@statdis varchar(15),<br />
@stat1dis varchar(15),<br />
@user varchar(6),<br />
@comp varchar(5)                  </p>
<p>As<br />
&#8211; exec payManualAttProc &#8217;10057&#8242;,&#8217;2010/02/02&#8242;,&#8217;PL&#8217;,'PL&#8217;,&#8221;,&#8217;INT01&#8242;<br />
declare @i int,@j int,@lcode varchar(15),@stat1 char(1),@stat2 char(2),@pin int,@maxno int,@lform varchar(15),@holi varchar(15)<br />
select @i = 0<br />
select @j = 0                  </p>
<p>If @statdis = &#8216;Present&#8217;<br />
begin<br />
    select @stat1 = &#8216;P&#8217;<br />
    select @i = 0<br />
end<br />
Else If @statdis = &#8216;RL&#8217;<br />
begin<br />
    select @stat1 = &#8216;P&#8217;<br />
    select @lcode = &#8216;INT01RIL001&#8242;<br />
    select @i = 1<br />
end<br />
Else If @statdis = &#8216;Absent&#8217;<br />
begin<br />
    select @stat1 = &#8216;A&#8217;<br />
    select @i = 0<br />
end<br />
Else If @statdis = &#8216;PL&#8217;<br />
begin<br />
    select @stat1 = &#8216;E&#8217;<br />
    select @lcode = &#8216;INT01EAR001&#8242;<br />
    select @i= 1<br />
end<br />
Else If @statdis = &#8216;ML&#8217;<br />
begin<br />
    select @stat1 = &#8216;F&#8217;<br />
    select @lcode = &#8216;INT01MAT001&#8242;<br />
    select @i= 1<br />
end<br />
Else If @statdis = &#8216;LWP&#8217;<br />
begin<br />
    select @stat1 = &#8216;L&#8217;<br />
    select @lcode = &#8216;INT01LWP001&#8242;<br />
    select @i= 1<br />
end<br />
Else If @statdis = &#8216;CL&#8217;<br />
begin<br />
    select @stat1 = &#8216;C&#8217;<br />
    select @lcode = &#8216;INT01CAS001&#8242;<br />
    select @i= 1<br />
end<br />
Else If @statdis = &#8216;SL&#8217;<br />
begin<br />
    select @stat1 = &#8216;S&#8217;<br />
    select @lcode = &#8216;INT01SHO001&#8242;<br />
    select @i= 2<br />
end<br />
Else If @statdis = &#8216;Late&#8217;<br />
begin<br />
    select @stat1 = &#8216;T&#8217;<br />
end<br />
Else If @statdis = &#8216;Out Duty&#8217;<br />
begin<br />
    select @stat1 = &#8216;O&#8217;<br />
    select @lcode = &#8216;INT01ODD001&#8242;<br />
    select @i= 2<br />
end<br />
Else If @statdis = &#8216;Tour&#8217;<br />
begin<br />
    select @stat1 = &#8216;R&#8217;<br />
    select @lcode = &#8216;INT01TOU001&#8242;<br />
    select @i= 1<br />
end<br />
Else If @statdis = &#8216;SICK&#8217;<br />
begin<br />
    select @stat1 = &#8216;K&#8217;<br />
    select @lcode = &#8216;INT01SIC001&#8242;<br />
    select @i= 2<br />
end<br />
Else If @statdis = &#8217;1/2 CL&#8217;<br />
begin<br />
    select @stat1 = &#8216;Y&#8217;<br />
    select @lcode = &#8216;INT01SUN014&#8242;<br />
    select @i= 2<br />
end<br />
Else If @statdis = &#8216;Compensation&#8217;<br />
begin<br />
    select @stat1 = &#8216;M&#8217;<br />
    select @lcode = &#8216;INT01COM001&#8242;<br />
    select @i= 2<br />
end<br />
Else<br />
begin<br />
    select @stat1 = &#8221;<br />
    select @lcode = &#8221;<br />
    select @i= 0<br />
End                   </p>
<p>If @stat1dis = &#8216;Present&#8217;<br />
begin<br />
    select @stat2 = &#8216;P&#8217;<br />
    select @j = 0<br />
end<br />
Else If @stat1dis = &#8216;RL&#8217;<br />
begin<br />
    select @stat2 = &#8216;P&#8217;<br />
    select @lcode = &#8216;INT01RIL001&#8242;<br />
end<br />
Else If @stat1dis = &#8216;Absent&#8217;<br />
begin<br />
    select @stat2 = &#8216;A&#8217;<br />
end<br />
Else If @stat1dis = &#8216;PL&#8217;<br />
begin<br />
    select @stat2 = &#8216;E&#8217;<br />
    select @lcode = &#8216;INT01EAR001&#8242;<br />
end<br />
Else If @stat1dis = &#8216;ML&#8217;<br />
begin<br />
    select @stat2 = &#8216;F&#8217;<br />
    select @lcode = &#8216;INT01MAT001&#8242;<br />
end<br />
Else If @stat1dis = &#8216;LWP&#8217;<br />
begin<br />
    select @stat2 = &#8216;L&#8217;<br />
    select @lcode = &#8216;INT01LWP001&#8242;<br />
end<br />
Else If @stat1dis = &#8216;CL&#8217;<br />
begin<br />
    select @stat2 = &#8216;C&#8217;<br />
    select @lcode = &#8216;INT01CAS001&#8242;<br />
end<br />
Else If @stat1dis = &#8216;SL&#8217;<br />
begin<br />
    select @stat2 = &#8216;S&#8217;<br />
    select @lcode = &#8216;INT01SHO001&#8242;<br />
    select @j = 3<br />
end<br />
Else If @stat1dis = &#8216;Late&#8217;<br />
begin<br />
    select @stat2 = &#8216;T&#8217;<br />
end<br />
Else If @stat1dis = &#8216;Out Duty&#8217;<br />
begin<br />
    select @stat2 = &#8216;O&#8217;<br />
    select @lcode = &#8216;INT01ODD001&#8242;<br />
    select @j = 3<br />
end<br />
Else If @stat1dis = &#8216;Tour&#8217;<br />
begin<br />
    select @stat2 = &#8216;R&#8217;<br />
    select @lcode = &#8216;INT01TOU001&#8242;<br />
end<br />
Else If @stat1dis = &#8216;SICK&#8217;<br />
begin<br />
    select @stat2 = &#8216;K&#8217;<br />
    select @lcode = &#8216;INT01SIC001&#8242;<br />
    select @j = 3<br />
end<br />
Else If @stat1dis = &#8217;1/2 CL&#8217;<br />
begin<br />
    select @stat2 = &#8216;Y&#8217;<br />
    select @lcode = &#8216;INT01SUN014&#8242;<br />
   select @j = 3<br />
end<br />
Else If @stat1dis = &#8216;Compensation&#8217;<br />
begin<br />
    select @stat2 = &#8216;M&#8217;<br />
    select @lcode = &#8216;INT01COM001&#8242;<br />
    select @j = 3<br />
end<br />
Else<br />
begin<br />
    select @stat2 = &#8221;<br />
    select @lcode = &#8221;<br />
End                   </p>
<p>If datename(dw,@dt) = &#8216;Sunday&#8217;<br />
 select @holi = &#8216;INT01SUN001&#8242;<br />
else<br />
 select @holi = &#8221;                  </p>
<p>If @stat1 = &#8216;P&#8217; And @stat2 = &#8216;P&#8217; And @stat1dis = &#8216;Present&#8217;<br />
    select @lcode = &#8221;                  </p>
<p>If @i = 1 Or @i + @j = 5<br />
    select @pin = 1<br />
Else<br />
    select @pin = @i + @j                  </p>
<p> if exists (select * from pay_leave_form_tmp where emp_code=@empcode and convert(varchar,date_from,111)=@dt and l_city=&#8217;P')<br />
   BEGIN     </p>
<p>      raiserror (&#8216;Leave already pending for approval this date. Updates for this date aborted&#8217;,10,1)     </p>
<p>      END        </p>
<p>     If @pin &gt; 0<br />
  begin<br />
            select @maxNo=max(convert(int , right(leave_form_code,6))) from pay_leave_form where left(leave_form_code,5) = @comp<br />
            select @lform = @comp + replicate(&#8217;0&#8242;,6-len(@maxno))+ ltrim(str(@maxno+1))                   </p>
<p>&#8211;select * from master.dbo.sysmessages where error &gt; 50000                </p>
<p>&#8212;select * from pay_leave_form where emp_code=&#8217;10057&#8242;<br />
            insert into pay_leave_form(emp_code,leave_form_code,leave_code,date_from,date_to,no_of_days,l_address1,l_address2,l_address3,<br />
                                        l_city,l_pin,created_by,created_on,last_touch_by,last_touch_on,holiday)<br />
            values(@empcode,@lform,@lcode,@dt,@dt,1,&#8221;,&#8221;,&#8217;Entry by Personal&#8217;,&#8221;,@pin,@user,getdate(),@user,getdate(),0)                  </p>
<p>     End<br />
&#8211;     select * from pay_attendence  where emp_code = @empcode and month(date) =&#8217; &amp; Mid(mskdate.Text, 4, 2) &amp; &#8216; and year(date) = &#8216; &amp; Right(mskdate.Text, 4), con, adOpenForwardOnly, adLockReadOnly                  </p>
<p> If @stat1  &#8221; Or @stat2  &#8221;<br />
 begin<br />
  if exists (select * from pay_attendence where emp_code=@empcode and convert(varchar,date,111)=@dt )<br />
   begin<br />
    update pay_attendence set status = @stat1, status1 =@stat2, leave_code =@lcode ,holiday_code =@holi,<br />
    last_touch_by = @user, last_touch_on = getdate() where emp_code = @empcode and convert(varchar,date,111) =@dt<br />
  end<br />
  else<br />
  begin<br />
   insert into pay_attendence ( emp_code , date ,incomingtime, outgoingtime ,status , status1 ,leave_code,holiday_code,created_by,<br />
       created_on ,last_touch_by, last_touch_on)<br />
   values (@empcode,@dt,@dt,@dt,@stat1 ,@stat2,&#8221;,@holi,@user,getdate(),@user,getdate())<br />
  End<br />
  end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Preet</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-272542</link>
		<dc:creator><![CDATA[Preet]]></dc:creator>
		<pubDate>Thu, 05 Apr 2012 17:23:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-272542</guid>
		<description><![CDATA[This can also occur if you browse indexes in SSMS whilst indexes are being created (even if the index you are browsing is not currently being created). SQL attempts to acquire a KEY lock but is unable to do so as the system catalog/tables is/are locked by the script/job that is creating the indexes.]]></description>
		<content:encoded><![CDATA[<p>This can also occur if you browse indexes in SSMS whilst indexes are being created (even if the index you are browsing is not currently being created). SQL attempts to acquire a KEY lock but is unable to do so as the system catalog/tables is/are locked by the script/job that is creating the indexes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-193790</link>
		<dc:creator><![CDATA[Dennis]]></dc:creator>
		<pubDate>Sat, 12 Nov 2011 09:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-193790</guid>
		<description><![CDATA[Thanks you saved my neck. Good job.]]></description>
		<content:encoded><![CDATA[<p>Thanks you saved my neck. Good job.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atcheswara</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-186809</link>
		<dc:creator><![CDATA[Atcheswara]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 06:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-186809</guid>
		<description><![CDATA[Hi 

I am getting same error when i opening the database properties.Can you please advise me.]]></description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>I am getting same error when i opening the database properties.Can you please advise me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rossky</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-152494</link>
		<dc:creator><![CDATA[rossky]]></dc:creator>
		<pubDate>Tue, 02 Aug 2011 01:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-152494</guid>
		<description><![CDATA[thanks, helped me a lot!]]></description>
		<content:encoded><![CDATA[<p>thanks, helped me a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prashanth</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-135083</link>
		<dc:creator><![CDATA[prashanth]]></dc:creator>
		<pubDate>Wed, 18 May 2011 21:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-135083</guid>
		<description><![CDATA[Hi there, 
I faced similar problem today. Fortunately the session which caused table lock to occur was still open. 
I did ROLLBACK TRAN in the same session and issue got fixed. 
you can try above suggested troubleshooting steps if you unfortunately close the session. 

Cheers,
Keep it simple :)]]></description>
		<content:encoded><![CDATA[<p>Hi there,<br />
I faced similar problem today. Fortunately the session which caused table lock to occur was still open.<br />
I did ROLLBACK TRAN in the same session and issue got fixed.<br />
you can try above suggested troubleshooting steps if you unfortunately close the session. </p>
<p>Cheers,<br />
Keep it simple :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Farhang Amary</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-74926</link>
		<dc:creator><![CDATA[Farhang Amary]]></dc:creator>
		<pubDate>Sun, 06 Jun 2010 05:44:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-74926</guid>
		<description><![CDATA[thanks
there wase usefull for me

I am writing a programm, in that programm in somewhere i need to kill some process. i use that query]]></description>
		<content:encoded><![CDATA[<p>thanks<br />
there wase usefull for me</p>
<p>I am writing a programm, in that programm in somewhere i need to kill some process. i use that query</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: clementratel</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-46534</link>
		<dc:creator><![CDATA[clementratel]]></dc:creator>
		<pubDate>Tue, 10 Feb 2009 17:51:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-46534</guid>
		<description><![CDATA[Hi,

I try to drop an index which is huge and I get the error message &quot;Lock request time out period exceeded&quot;

I have no lock on the database returned by the script mentioned here.
I have no transaction running on the database.

Do you know what else could I check ?

a+, =)
-=Clement=-

Configuration : SQL Server 2005]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I try to drop an index which is huge and I get the error message &#8220;Lock request time out period exceeded&#8221;</p>
<p>I have no lock on the database returned by the script mentioned here.<br />
I have no transaction running on the database.</p>
<p>Do you know what else could I check ?</p>
<p>a+, =)<br />
-=Clement=-</p>
<p>Configuration : SQL Server 2005</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vivek</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-44779</link>
		<dc:creator><![CDATA[Vivek]]></dc:creator>
		<pubDate>Sat, 13 Dec 2008 13:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-44779</guid>
		<description><![CDATA[Thank you very much. Great Job!!]]></description>
		<content:encoded><![CDATA[<p>Thank you very much. Great Job!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramzi</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-43126</link>
		<dc:creator><![CDATA[ramzi]]></dc:creator>
		<pubDate>Mon, 22 Sep 2008 16:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-43126</guid>
		<description><![CDATA[the command 

Kill — The concerned spid


?
getting an error there... any idea plz?]]></description>
		<content:encoded><![CDATA[<p>the command </p>
<p>Kill — The concerned spid</p>
<p>?<br />
getting an error there&#8230; any idea plz?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prakash</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-42659</link>
		<dc:creator><![CDATA[Prakash]]></dc:creator>
		<pubDate>Wed, 10 Sep 2008 20:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-42659</guid>
		<description><![CDATA[Thank you very much.I have resolved the issue using ur script]]></description>
		<content:encoded><![CDATA[<p>Thank you very much.I have resolved the issue using ur script</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spade</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-10907</link>
		<dc:creator><![CDATA[Spade]]></dc:creator>
		<pubDate>Mon, 03 Sep 2007 11:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/alternate-fix-error-1222-lock-request-time-out-period-exceeded/#comment-10907</guid>
		<description><![CDATA[Hello

Here is the script that can kill locks

Create Table #Tmp
(
	spid smallint,
	ecid smallint,
	status nchar(30),
	loginame nchar(128),
	hostname nchar(128),
	blk char(5),
	dbname nchar(128),
	cmd nchar(16)
)
 

Create Table #TmpLocks
(
	spid smallint,
	dbid smallint,
	ObjId int,
	IndId smallint,
	Type nchar(4),
	Resource nchar(16),
	Mode nvarchar(8),
	Status nvarchar(28)
)

Insert Into #Tmp
Exec sp_who

Insert Into #TmpLocks
Exec sp_lock


If(Select Count(*) From #Tmp T
	Join #TmpLocks TL On T.spid = TL.spid
	Where /*This is for tempdb*/ dbid = 2 And objid In (1, 2, 3)) &gt; 0

Then you can kill the concerned spid with the command :

Kill -- The concerned spid

Drop Table #Tmp
Drop Table #TmpLocks]]></description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>Here is the script that can kill locks</p>
<p>Create Table #Tmp<br />
(<br />
	spid smallint,<br />
	ecid smallint,<br />
	status nchar(30),<br />
	loginame nchar(128),<br />
	hostname nchar(128),<br />
	blk char(5),<br />
	dbname nchar(128),<br />
	cmd nchar(16)<br />
)</p>
<p>Create Table #TmpLocks<br />
(<br />
	spid smallint,<br />
	dbid smallint,<br />
	ObjId int,<br />
	IndId smallint,<br />
	Type nchar(4),<br />
	Resource nchar(16),<br />
	Mode nvarchar(8),<br />
	Status nvarchar(28)<br />
)</p>
<p>Insert Into #Tmp<br />
Exec sp_who</p>
<p>Insert Into #TmpLocks<br />
Exec sp_lock</p>
<p>If(Select Count(*) From #Tmp T<br />
	Join #TmpLocks TL On T.spid = TL.spid<br />
	Where /*This is for tempdb*/ dbid = 2 And objid In (1, 2, 3)) &gt; 0</p>
<p>Then you can kill the concerned spid with the command :</p>
<p>Kill &#8212; The concerned spid</p>
<p>Drop Table #Tmp<br />
Drop Table #TmpLocks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
