<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-476654072865391162</id><updated>2012-01-29T21:58:04.003-08:00</updated><category term='JavaScript'/><title type='text'>BM Web</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-5065916591782630819</id><published>2008-06-20T02:16:00.000-07:00</published><updated>2008-06-20T02:57:38.522-07:00</updated><title type='text'>How to have a HTML FORM as part of EMail?</title><content type='html'>Today I came across a very interesting scenario wherein we have to send a survey form as a part of email. I mean email itself shall contain the complete HTML (including form tag) where in user is going to provide the information and submit the same.&lt;br /&gt;&lt;br /&gt;The sample HTML survey form in email shall look like&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5213893664664128578" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_c27i5O7J1oU/SFt4qeL3DEI/AAAAAAAAAOs/9daCUbMjQW4/s400/7.jpg" border="0" /&gt;&lt;br /&gt;Ideally we can send an email to user and include just the URL of the survey page instead of the complete HTML as a part of the mail itself. But in many cases such as surveys, feedbacks the willingness of clicking on URL and opening it in browser and then submitting the same is less.&lt;br /&gt;&lt;br /&gt;Whereas if we provide the same HTML Form as a part of email itself then the probability of filling and submitting these kinds of surveys/ feedbacks is more.&lt;br /&gt;&lt;br /&gt;Generally whenever I wanted to send any formatted HTML in mail I used to design with my favorite designer/editor and then browse the HTML in any browser and then copy from browser and paste in the new mail window of outlook.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;&lt;strong&gt;This time also I did the same and see what; my usual method is &lt;span style="color:#ff6666;"&gt;failed &lt;/span&gt;when I pasted the formatted HTML from browser to outlook.&lt;/strong&gt;&lt;/span&gt; Surprisingly outlook removed only the &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;FROM&lt;/strong&gt;&lt;/span&gt; tag from my all HTML content. And hence the user will not able to submit the survey to any website.&lt;br /&gt;&lt;br /&gt;This time it replace FROM tag as just simple text as below&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5213891490199128546" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_c27i5O7J1oU/SFt2r5rASeI/AAAAAAAAAOM/PqC91uTTYdg/s400/3.jpg" border="0" /&gt;&lt;img id="BLOGGER_PHOTO_ID_5213891558343618482" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_c27i5O7J1oU/SFt2v3h6r7I/AAAAAAAAAOU/QpWY9Wb8NzU/s400/4.jpg" border="0" /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;I tried all possible things but no luck. Then I thought if somehow I put this FORM tag as part of mail body then it might work. So started generating the complete mail programmatically including FORM tag and send it to the user, and there we are, we got the solution. Now user can fill and submit the form from email itself.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here I did very simple string formation using C#&lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5213891755412463010" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_c27i5O7J1oU/SFt27VqynaI/AAAAAAAAAOk/4hjqMhM0Lrg/s400/5.jpg" border="0" /&gt;&lt;/p&gt;&lt;p&gt;And then finally set this as mail body and send the mail. &lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5213891626012278114" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_c27i5O7J1oU/SFt2zznYfWI/AAAAAAAAAOc/uCeVat0-Lh4/s400/6.jpg" border="0" /&gt;&lt;br /&gt;But before using this solution I want to highlight few things&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It’s not good idea to have forms as part the mail itself, but if situation demands here is the solution.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you want to do any script validation (JavaScript), then by default in outlook it’s disabled as a result none of the JavaScript will be fired.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;I tried submitting from Outlook 2007 it didn't work, probably there might be some security constraint.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If the generated mail is forwarded then the recipient of the mail cannot submit the form as outlook would remove the FORM tag.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Hope this information helps you.In case if you find any information here is wrong please feel free to write to me &lt;a href="mailto:Bharat.Mane@gmail.com"&gt;Bharat.Mane@gmail.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thank You&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Bharat Mane&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-5065916591782630819?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/5065916591782630819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=5065916591782630819' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/5065916591782630819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/5065916591782630819'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2008/06/how-to-have-html-form-as-part-of-email.html' title='How to have a HTML FORM as part of EMail?'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c27i5O7J1oU/SFt4qeL3DEI/AAAAAAAAAOs/9daCUbMjQW4/s72-c/7.jpg' height='72' width='72'/><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-4809452359168597992</id><published>2008-05-19T08:06:00.000-07:00</published><updated>2008-05-19T08:44:34.406-07:00</updated><title type='text'>MS SQL Server 2005 - Linked Servers One Has to Know</title><content type='html'>A linked server is a fantastic feature provided by Microsoft with Microsoft &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SQL&lt;/span&gt;&lt;/span&gt; Server to talk to a remote Microsoft &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SQL&lt;/span&gt;&lt;/span&gt; Server. This can be set up using the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SQL&lt;/span&gt;&lt;/span&gt; Enterprise Manager interface or by using the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;sp&lt;/span&gt;&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;addlinkedserver&lt;/span&gt;&lt;/span&gt; stored procedure.&lt;br /&gt;You can find the detailed information at&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms188279.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms188279.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms188477.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms188477.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Now let’s talk about the some of the things that I learned about Linked Servers;&lt;/strong&gt;&lt;br /&gt;In one of my projects we have many interrelated application running on MS &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;SQL&lt;/span&gt;&lt;/span&gt; 2005 server. And for various reasons these servers share lot of information among themselves by using &lt;strong&gt;[Database Name].[Schema Name].[Object Name].&lt;/strong&gt; These application are running fine for last couple of years but since the load contributed by these various application is increasing day-by-day, so we decided to have one more MS &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;SQL&lt;/span&gt;&lt;/span&gt; Sever and move few databases from present one to new one. But there were hundreds of stored procedures, triggers, views, and function using the database objects as &lt;strong&gt;[Database Name].[Schema Name].[Object Name].&lt;/strong&gt; So, for us it was a big challenge to separate them without disturbing their coupling.&lt;br /&gt;&lt;br /&gt;This is where we thought using linked servers and wherever we are using &lt;strong&gt;[Database Name].[Schema Name].[Object Name]&lt;/strong&gt; we decided to use &lt;strong&gt;[Server Name].[Database Name].[Schema Name].[Object Name]&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;But hang on techies, though it looks simple and straight forward which actually it is, there is a hidden cost which you have to pay if your application is falling in one of the following scenarios&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Using remote server objects in transaction, &lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Using remote views which reference multiple tables&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Using remote server objects in cursors&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Using Identity output variables which references remote server objects , &lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;And last but not the least if you miss &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;MSDTC&lt;/span&gt;&lt;/span&gt; settings;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;Thanks to Microsoft support &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;techies &lt;/span&gt;and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;Google&lt;/span&gt; who gave me whole lot of information on &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;handling&lt;/span&gt; these issues.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;strong&gt;Before you get into debugging any issues, use this &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;DTSPING&lt;/span&gt;&lt;/span&gt; utility to check whether your both the DB servers are communicating properly.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/florinlazar/archive/2005/09/16/469064.aspx"&gt;&lt;strong&gt;http://blogs.msdn.com/florinlazar/archive/2005/09/16/469064.aspx&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;&lt;span style="color:#000000;"&gt;Then probably have a look at this article on&lt;/span&gt; &lt;strong&gt;How to troubleshoot error 7391 that occurs when you use a linked server in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;SQL&lt;/span&gt;&lt;/span&gt; Server&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/306212"&gt;&lt;span style="color:#3333ff;"&gt;&lt;strong&gt;http://support.microsoft.com/kb/306212&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;Then if you face any errors listed below, I have few pointer to MS KB.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Server: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;Msg&lt;/span&gt;&lt;/span&gt; 7391, Level 16, State 1, Line 1The operation could not be performed because OLE DB provider "%ls" for linked server "%ls" was unable to begin a distributed transaction.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Distributed transaction aborted by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;MSDTC&lt;/span&gt;&lt;/span&gt;.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color:#3333ff;"&gt;&lt;strong&gt;Resolution&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/306212"&gt;http://support.microsoft.com/kb/306212&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Server: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;Msg&lt;/span&gt;&lt;/span&gt; 8180, Level 16, State 1, Line 2 Statement(s) could not be prepared.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="color:#3333ff;"&gt;&lt;strong&gt;Resolution&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;Many &lt;/span&gt;places we use cursors and in sometimes in the cursors we use linked server objects/remote objects in those cases you might get this kind of error.&lt;br /&gt;To resolve this you may follow the methods specified by Microsoft. Or even you can use while loop instead of cursor (Please note that it may not remove your problem in all cases)&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/826860"&gt;http://support.microsoft.com/kb/826860&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;Msg&lt;/span&gt;&lt;/span&gt; 1206, Level 18, State 167, Line 3 The Microsoft Distributed Transaction Coordinator (MS &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;DTC&lt;/span&gt;&lt;/span&gt;) has cancelled the distributed transaction.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;SQL&lt;/span&gt;&lt;/span&gt; Native Client OLE DB provider (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;SQLNCLI&lt;/span&gt;&lt;/span&gt;) in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;SQL&lt;/span&gt;&lt;/span&gt; Server 2005 to create a linked server. You create a distributed transaction. The distributed transaction contains a query that uses the linked server to retrieve data from a table. When you commit the distributed transaction, you may receive the following error message&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;The Microsoft Distributed Transaction Coordinator (MS &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;DTC&lt;/span&gt;&lt;/span&gt;) has cancelled the distributed transaction.&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;Sometimes&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;Resolution&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/937517"&gt;http://support.microsoft.com/kb/937517&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Server: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;Msg&lt;/span&gt;&lt;/span&gt; 16955, Level 16, State 2, Line 0Could not create an acceptable cursor.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Server: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;Msg&lt;/span&gt;&lt;/span&gt; 16945, Level 16, State 1, Procedure &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;sp&lt;/span&gt;&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;cursoropen&lt;/span&gt;&lt;/span&gt;, Line 57The cursor was not declared.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;Resolution&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/302477"&gt;http://support.microsoft.com/kb/302477&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;You have two instances of Microsoft &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;SQL&lt;/span&gt;&lt;/span&gt; Server 2005 that are named Instance1 and Instance2. &lt;/li&gt;&lt;li&gt;In Instance1, you have a table that has the following characteristics:&lt;br /&gt;§ The table has a column of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;VARCHAR&lt;/span&gt;&lt;/span&gt; data type.&lt;br /&gt;§ The table has no clustered index.&lt;br /&gt;§ The column of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;VARCHAR&lt;/span&gt;&lt;/span&gt; data type is not indexed.&lt;br /&gt;§ The table has many rows. For example, the table has 100,000 or more rows.&lt;/li&gt;&lt;li&gt;In Instance2, you perform the following operations:&lt;br /&gt;§ You create a linked server to Instance1.&lt;br /&gt;§ You run an UPDATE statement against the linked server to update the column of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;VARCHAR&lt;/span&gt;&lt;/span&gt; data type in the table in Instance1.&lt;br /&gt;In this scenario, the update operation may be performed on incorrect rows&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;Resolution&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/?id=951185"&gt;http://support.microsoft.com/?id=951185&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In your application if you create a linked server that is linked to the local server itself. This configuration is also known as a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;loopback&lt;/span&gt;&lt;/span&gt; linked server. Then, you create a stored procedure that contains a statement that resembles the following statement:&lt;br /&gt;o INSERT &lt;localtable&gt;EXEC &lt;linkedserver&gt;.&lt;procedurename&gt;&lt;br /&gt;You will receive an error message as&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;Msg&lt;/span&gt;&lt;/span&gt; 3910, Level 16, State 2, Line 1 Transaction context in use by another session.&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;Resolution&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/?id=947486"&gt;http://support.microsoft.com/?id=947486&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In Microsoft &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;SQL&lt;/span&gt;&lt;/span&gt; Server 2005, you run a transaction from a remote server by using a linked server. The transaction contains a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;DML&lt;/span&gt;&lt;/span&gt; statement that is followed by a data definition language (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;DDL&lt;/span&gt;&lt;/span&gt;) statement. For example, the transaction contains an INSERT statement that is followed by a DROP TABLE statement. In this scenario, you receive the following error message when you run the transaction:&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Server: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;Msg&lt;/span&gt;&lt;/span&gt; 3970, Level 16, State 2, Line 1 This operation conflicts with another pending operation on this transaction. The operation failed.&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;Resolution&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/949687"&gt;http://support.microsoft.com/kb/949687&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;In some scenarios the errors disappeared by enabling network Distributed Transaction Coordinator access&lt;br /&gt;This article describes the procedure that you follow to enable network Distributed Transaction Coordinator (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;DTC&lt;/span&gt;&lt;/span&gt;) access in Microsoft Windows Server 2003.&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/817064"&gt;http://support.microsoft.com/kb/817064&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Apart from all the above here are few more related articles.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a title="http://support.microsoft.com/kb/817064" href="http://support.microsoft.com/kb/817064"&gt;How to enable network &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;DTC&lt;/span&gt;&lt;/span&gt; access in Windows Server 2003&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="http://support.microsoft.com/kb/301600/" href="http://support.microsoft.com/kb/301600/"&gt;How to configure Microsoft Distributed Transaction Coordinator on a Windows Server 2003 cluster&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="http://support.microsoft.com/?id=" href="http://support.microsoft.com/?id=250367"&gt;Configuring Microsoft Distributed Transaction Coordinator (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;DTC&lt;/span&gt;&lt;/span&gt;) to work through a firewall&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="http://support.microsoft.com/?id=" href="http://support.microsoft.com/?id=839880"&gt;Troubleshooting &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;RPC&lt;/span&gt;&lt;/span&gt; Endpoint Mapper errors using the Windows Server 2003 Support Tools from the product CD&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="http://support.microsoft.com/kb/325930" href="http://support.microsoft.com/kb/325930"&gt;How to troubleshoot connectivity issues that are caused by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;RPC&lt;/span&gt;&lt;/span&gt; client protocol registry entries&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Hope this information helps you.&lt;br /&gt;In case if you find any information here is wrong please feel free to write to me &lt;a href="mailto:Bharat.Mane@gmail.com"&gt;Bharat.Mane@gmail.com&lt;/a&gt;&lt;br /&gt;Thank You&lt;br /&gt;&lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;Bharat&lt;/span&gt;&lt;/span&gt; Mane&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-4809452359168597992?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/4809452359168597992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=4809452359168597992' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/4809452359168597992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/4809452359168597992'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2008/05/ms-sql-server-2005-linked-servers-one.html' title='MS SQL Server 2005 - Linked Servers One Has to Know'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-685531357960933976</id><published>2008-05-01T23:36:00.000-07:00</published><updated>2008-05-02T00:31:30.195-07:00</updated><title type='text'>ASP.NET Using MaxLength, One has to know.</title><content type='html'>One of the basic validations that we do in our day-to-day programming is checking the length of the data. In web application, in ASP.NET we have a textbox control and there is a property called &lt;span style="color:#ff6666;"&gt;MaxLength&lt;/span&gt;. The &lt;span style="color:#ff0000;"&gt;maxLength&lt;/span&gt; property sets or returns the maximum number of characters in a text field. Say for example if we have set the value for the &lt;span style="color:#ff0000;"&gt;maxlength&lt;/span&gt; is 20 and user is trying to enter data which is more than 20 characters then it will not allow to do the same, it works well even if user paste a text which is more than 20 characters.&lt;br /&gt;There is one scenario where it fails, actually I shall not say it fails rather it is not meant for such scenario. The scenario is when we set &lt;span style="color:#ff0000;"&gt;maxlength&lt;/span&gt; to 20 as shown below&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5195675874589068962" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_c27i5O7J1oU/SBq_rhjyzqI/AAAAAAAAAFk/pGXaNLUBH-s/s400/1.gif" border="0" /&gt;&lt;br /&gt;And in code behind if we set text property of textbox programmatically as shown below&lt;img id="BLOGGER_PHOTO_ID_5195676037797826226" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_c27i5O7J1oU/SBq_1BjyzrI/AAAAAAAAAFs/ObzLLmFTLuw/s400/2.gif" border="0" /&gt;In this case the resulting screen would be&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5195676261136125634" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_c27i5O7J1oU/SBrACBjyzsI/AAAAAAAAAF0/HQGb5NsIYak/s400/3.gif" border="0" /&gt;This means, in this case it does not restrict maximum number of characters to 20, the reason is, if you see the source of the page (the rendered HTML)&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5195676587553640146" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_c27i5O7J1oU/SBrAVBjyztI/AAAAAAAAAF8/MwZbJzLFFpI/s400/4.gif" border="0" /&gt;Here the &lt;span style="color:#ff0000;"&gt;MaxLength&lt;/span&gt; property of asp.net control gets converted to maxlength property of HTML and this is meant for client validation and not for server validation. And we are trying to set the value at the server side, which leads to a wrong validation.&lt;br /&gt;&lt;span style="color:#ff6666;"&gt;&lt;strong&gt;Here one has to be aware of this while using MaxLength property.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#6666cc;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#6666cc;"&gt;Another interesting fact about the MaxLength property is, it does not work when you set &lt;span style="color:#ff0000;"&gt;TextMode&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;="&lt;/span&gt;MultiLine"&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Say for example we have scenario as shown below&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5195677025640304370" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_c27i5O7J1oU/SBrAuhjyzvI/AAAAAAAAAGM/jyr_PCmilxM/s400/4.5.gif" border="0" /&gt;Now if you see source of this page it will be as show below&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5195676879611416290" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_c27i5O7J1oU/SBrAmBjyzuI/AAAAAAAAAGE/xJ3C0lS-xIY/s400/6.gif" border="0" /&gt;As we know when we set &lt;span style="color:#ff0000;"&gt;TextMode&lt;/span&gt;=&lt;span style="color:#6633ff;"&gt;"MultiLine"&lt;/span&gt;, it gets rendered as textarea and surprisingly there is no equivalent attribute/property available for textaera for &lt;span style="color:#ff0000;"&gt;MaxLength&lt;/span&gt;&lt;br /&gt;So in case of &lt;span style="color:#ff0000;"&gt;TextMode&lt;/span&gt;=&lt;span style="color:#6666cc;"&gt;"MultiLine"&lt;/span&gt; or when we use HTML textarea we do not have any property which will restrict maxlength. In this case we can write our own javascript function which will check the length on every key press in the textarea. There are many sample available on internet for this.&lt;br /&gt;Few of them are at&lt;br /&gt;&lt;a href="http://www.dynamicdrive.com/dynamicindex16/limitinput.htm"&gt;http://www.dynamicdrive.com/dynamicindex16/limitinput.htm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.quirksmode.org/dom/maxlength.html"&gt;http://www.quirksmode.org/dom/maxlength.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope this information helps you.&lt;br /&gt;In case if you find any information here is wrong please feel free to write to me &lt;a href="mailto:Bharat.Mane@gmail.com"&gt;Bharat.Mane@gmail.com&lt;/a&gt;&lt;br /&gt;Thank You&lt;br /&gt;&lt;strong&gt;Bharat Mane&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-685531357960933976?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/685531357960933976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=685531357960933976' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/685531357960933976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/685531357960933976'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2008/05/aspnet-using-maxlength-one-has-to-know.html' title='ASP.NET Using MaxLength, One has to know.'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_c27i5O7J1oU/SBq_rhjyzqI/AAAAAAAAAFk/pGXaNLUBH-s/s72-c/1.gif' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-6034049494049786996</id><published>2008-04-09T20:52:00.001-07:00</published><updated>2008-04-09T21:05:04.621-07:00</updated><title type='text'>Integrate Microsoft Office Communicator with your Application</title><content type='html'>While I was using our team room sites which are hosted on share point, I was interested in knowing &lt;strong&gt;“How a website shows the status of user which is there in Microsoft Office Communicator?”&lt;/strong&gt; and my search started to integrate Microsoft Office Communicator with my web application.&lt;br /&gt;So here we have Microsoft Office Communicator installed on user’s machine&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5187460183231396962" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_c27i5O7J1oU/R_2PjWP9fGI/AAAAAAAAAFU/okjPePQjOOE/s400/Demo0.jpg" border="0" /&gt;Luckily I came to know about &lt;strong&gt;NameCtrl Control&lt;/strong&gt;&lt;br /&gt;A &lt;strong&gt;NameCtrl&lt;/strong&gt; control is an ActiveX control that allows a Web page to display presence information for people, and it allows the user to take various actions with respect to those people through an on-object user interface (UI) in Windows SharePoint Services.&lt;br /&gt;For more details please check out msdn&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms455335.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms455335.aspx&lt;/a&gt;&lt;br /&gt;And with small code I could able to come up a HTML page as below,&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5187460522533813362" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_c27i5O7J1oU/R_2P3GP9fHI/AAAAAAAAAFc/DaVkC7UemZQ/s400/Demo.jpg" border="0" /&gt;The code is very simple and easy to use,&lt;br /&gt;&lt;span style="font-size:0;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;pre&gt;&lt;br /&gt;HTML Format should be as below&lt;br /&gt;&amp;lt;span&amp;gt;&lt;br /&gt;&lt;b&gt;DISPLAYNAME &lt;/b&gt;&lt;br /&gt;&amp;lt;img border='0' height='12' width='12' src='imnunk.GIF' onload="javascript:SPEEDIMNRC('SIPADDRESS')" id='UNIQUE - ID'&amp;gt;&lt;br /&gt;&amp;lt;/span&amp;gt;&lt;br /&gt;EXAMPLE:&lt;br /&gt;&amp;lt;span&amp;gt;&lt;br /&gt;&lt;b&gt;Bharat Mane &lt;/b&gt;&lt;br /&gt;&amp;lt;img border='0' height='12' width='12' src='imnunk.GIF' onload="javascript:SPEEDIMNRC('bharat.mane@domainname.com')"id='imn7'&amp;gt;&lt;br /&gt;&amp;lt;/span&amp;gt;&lt;br /&gt;&amp;lt;span&amp;gt;&lt;br /&gt;Bharat Mane&lt;br /&gt;&amp;lt;img border='0' height='12' width='12' src='imnunk.GIF' onload="javascript:SPEEDIMNRC('E198456@domainname.com')" id='imn7'&amp;gt;&lt;br /&gt;&amp;lt;/span&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;span style="font-size:0;"&gt;&lt;p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Note:&lt;br /&gt;Most of the times one's email Id is their SIP Id. But as stated in the above example it might be different also. Good approach would be store and retrieve it from your own database&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;In the code above there is only one JavaScript function which is new other than basic HTML. This function is responsible to use the ActiveX Name.NameCtrl.1. The complete source code for this function is available in CommunicatorPresence.js.&lt;br /&gt;The complete source code is available at &lt;a href="http://bharat.mane.googlepages.com/CommunicatorPresence.zip"&gt;CommunicatorPresence.zip &lt;/a&gt;. &lt;/p&gt;&lt;p&gt;In case if you find any information here is wrong please feel free to write to me &lt;a href="mailto:Bharat.Mane@gmail.com"&gt;Bharat.Mane@gmail.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Thank You&lt;br /&gt;&lt;strong&gt;Bharat Mane&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-6034049494049786996?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/6034049494049786996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=6034049494049786996' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/6034049494049786996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/6034049494049786996'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2008/04/integrate-microsoft-office-communicator.html' title='Integrate Microsoft Office Communicator with your Application'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c27i5O7J1oU/R_2PjWP9fGI/AAAAAAAAAFU/okjPePQjOOE/s72-c/Demo0.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-1494701821752710242</id><published>2008-03-12T08:35:00.000-07:00</published><updated>2008-03-12T21:30:58.814-07:00</updated><title type='text'>MS SQL Determining Table sizes (in KB)</title><content type='html'>Today when I was looking at my database file size and to my surprise I saw the size of database was more than 10 Gigabytes. Then I was keen in knowing tables, which are contributing to this much big size. And Saravana, my colleague &lt;strong&gt;&lt;/strong&gt;gave a fantastic script to find out space used by each table. I thought let’s share it with everybody. Thanks to Microsoft who gave a built in stored procedure &lt;strong&gt;sp_spaceused&lt;/strong&gt;.&lt;br /&gt;With the help of this stored procedure one can easily find out the space with one line code&lt;br /&gt;exec sp_spaceused &amp;lt;Table Name &amp;gt;&lt;tablename&gt;&lt;tablename&gt;&lt;br /&gt;sample output&lt;br /&gt;&lt;br /&gt;name rows reserved data index_size unused&lt;name&gt; 17991232 12636448 KB 11051664 KB 1583816 KB 968 KB&lt;br /&gt;But I just wanted to find out tables, which are contributing more. Here is that handy script for any DBA&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;DECLARE&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;br /&gt;@DBTABLES&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;AS&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;span style="color:blue;"&gt;TABLE&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:gray;"  &gt;(&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;SNO &lt;span style="color:blue;"&gt;INT&lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;IDENTITY&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;1&lt;span style="color:gray;"&gt;,&lt;/span&gt;1&lt;span style="color:gray;"&gt;),&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;TABLENAME&lt;br /&gt;&lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;256&lt;span style="color:gray;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:gray;"  &gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;INSERT&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;span style="color:blue;"&gt;INTO&lt;/span&gt; @DBTABLES&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;SELECT&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;table_schema &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;'.'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; table_name&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;FROM&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;information_schema.TABLES&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;WHERE&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;table_type &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'BASE TABLE'&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:red;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;DECLARE&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;br /&gt;@DBTABLESINFO&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;AS&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;span style="color:blue;"&gt;TABLE&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:gray;"  &gt;(&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;SNO &lt;span style="color:blue;"&gt;INT&lt;/span&gt;&lt;span style="mso-tab-count: 1"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;IDENTITY&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;1&lt;span style="color:gray;"&gt;,&lt;/span&gt;1&lt;span style="color:gray;"&gt;),&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;TABLENAME &lt;span style="color:blue;"&gt;VARCHAr&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;256&lt;span style="color:gray;"&gt;),&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;ROWS&lt;span style="mso-tab-count: 1"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;char&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;11&lt;span style="color:gray;"&gt;),&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;reserved &lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;18&lt;span style="color:gray;"&gt;),&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;data &lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;18&lt;span style="color:gray;"&gt;),&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;index_size &lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;18&lt;span style="color:gray;"&gt;),&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;unused &lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;18&lt;span style="color:gray;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:gray;"  &gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;&lt;br /&gt;DECLARE&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; @COUNT&lt;br /&gt;&lt;span style="color:blue;"&gt;INT&lt;/span&gt; &lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2"&gt; &lt;/span&gt;@CURRENT &lt;span style="color:blue;"&gt;INT&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2"&gt; &lt;/span&gt;@TABLENAME &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;256&lt;span style="color:gray;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;SELECT&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; @COUNT &lt;span style="color:gray;"&gt;=&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;&lt;span style="color:fuchsia;"&gt;COUNT&lt;/span&gt;&lt;span style="color:gray;"&gt;(*)&lt;/span&gt; &lt;span style="color:blue;"&gt;FROM&lt;/span&gt; @DBTABLES&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;SET&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; @CURRENT &lt;span style="color:gray;"&gt;=&lt;/span&gt; 1&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;WHILE&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;span style="color:gray;"&gt;(&lt;/span&gt;@COUNT&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;&lt;span style="color:gray;"&gt;&amp;gt;=&lt;/span&gt; @CURRENT&lt;span style="color:gray;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;BEGIN&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; @TABLENAME &lt;span style="color:gray;"&gt;=&lt;/span&gt;&lt;br /&gt;TABLENAME &lt;span style="color:blue;"&gt;FROM&lt;/span&gt; @DBTABLES &lt;span style="color:blue;"&gt;WHERE&lt;/span&gt; SNO &lt;span style="color:gray;"&gt;=&lt;/span&gt;&lt;br /&gt;@CURRENT&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;INSERT&lt;/span&gt; &lt;span style="color:blue;"&gt;INTO&lt;/span&gt;&lt;br /&gt;@DBTABLESINFO&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 2"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;EXEC&lt;/span&gt; &lt;span style="color:maroon;"&gt;sp_spaceused&lt;/span&gt; @TABLENAME&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;SET&lt;/span&gt; @CURRENT &lt;span style="color:gray;"&gt;=&lt;/span&gt;&lt;br /&gt;@CURRENT &lt;span style="color:gray;"&gt;+&lt;/span&gt; 1&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;END&lt;br /&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;SELECT&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;TABLENAME&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;ROWS&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;DATA&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;convert&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:blue;"&gt;bigint&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:gray;"&gt;left(&lt;/span&gt;DATA&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;len&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;data&lt;span style="color:gray;"&gt;)-&lt;/span&gt;3&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;FROM&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt;&lt;span style="mso-tab-count: 1"&gt;&lt;/span&gt;@DBTABLESINFO&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';color:blue;"  &gt;ORDER&lt;/span&gt;&lt;span style="mso-no-proof: yes;font-family:'Courier New';" &gt; &lt;span style="color:blue;"&gt;BY&lt;/span&gt; 4 &lt;span style="color:blue;"&gt;DESC&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="mso-layout-grid-align: none"&gt;&lt;span style="font-family:arial;"&gt;Hope this will help.&lt;br /&gt;Regards&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;Bharat Mane&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-1494701821752710242?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/1494701821752710242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=1494701821752710242' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/1494701821752710242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/1494701821752710242'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2008/03/ms-sql-determining-table-sizes-in-kb.html' title='MS SQL Determining Table sizes (in KB)'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-7247169925735145339</id><published>2007-11-24T03:59:00.000-08:00</published><updated>2007-11-24T04:47:51.015-08:00</updated><title type='text'>File Upload in ASP.NET 2.0</title><content type='html'>Where I migrated to ASP.NET 2.0 there was a whole new world waiting for me, lots of new features, new control and many more... In all that there was one more and nice feature is &lt;strong&gt;"&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;FileUpload&lt;/span&gt;" &lt;/strong&gt;which made life of programmer more easy.&lt;br /&gt;&lt;?xml:namespace prefix = asp /&gt;&lt;asp:fileupload id="fUpload" runat="server"&gt;&lt;/asp:fileupload&gt;&lt;br /&gt;&lt;asp:fileupload runat="server"&gt;This control is not similar as that of ASP.NET 1.x, here you had to take a few extra steps to make use of it such as&lt;/asp:fileupload&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;asp:fileupload runat="server"&gt;In Classic ASP or ASP.NET 1.x we have to add &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;enctype&lt;/span&gt;="&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;multipart&lt;/span&gt;/form-data" &lt;/strong&gt;in form tag.&lt;/asp:fileupload&gt;&lt;/li&gt;&lt;li&gt;&lt;asp:fileupload runat="server"&gt;In classic many programmers use to write their own components to read the stream and save the data as file(s) or they use to use third party controls.&lt;/asp:fileupload&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;&lt;/asp:fileupload&gt;&lt;/p&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;While using this one has to know few key things about the control to get best out of it.&lt;/asp:fileupload&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;asp:fileupload runat="server"&gt;The default value for the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;maxRequestLength&lt;/span&gt;&lt;/strong&gt; parameter in the &lt;strong&gt;&lt;httpruntime&gt;&lt;/strong&gt;section of the Machine.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;config&lt;/span&gt; (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG) file is 4096 (4 megabytes). As a result, files that are larger than this value are not uploaded by default. &lt;/asp:fileupload&gt;&lt;asp:fileupload runat="server"&gt;We can &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;overwite&lt;/span&gt; this by required value in the web.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;config&lt;/span&gt;. This will &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;change &lt;/span&gt;the value to (8 megabytes) &lt;/asp:fileupload&gt;&lt;asp:fileupload runat="server"&gt;&lt;httpruntime maxrequestlength="8192"&gt;&lt;/asp:fileupload&gt;&lt;/li&gt;&lt;li&gt;&lt;asp:fileupload runat="server"&gt;The value given the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;executionTimeout&lt;/span&gt; &lt;/strong&gt;attribute is the number of seconds the upload is allowed to occur before being shut down by ASP.NET.&lt;/asp:fileupload&gt;&lt;/li&gt;&lt;li&gt;&lt;asp:fileupload runat="server"&gt;During the upload process, ASP.NET 1.x loads the whole file in memory before the user can save the file to the disk. Therefore, the process may recycle because of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;memoryLimit&lt;/span&gt; attribute of the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;processModel&lt;/span&gt;&lt;/strong&gt; tag in the Machine.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;config&lt;/span&gt; file. The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;memoryLimit&lt;/span&gt; attribute specifies the percentage of physical memory that the ASP.NET worker process can exhaust before the process is automatically recycled. Recycling prevents memory leaks from causing ASP.NET to crash or to stop responding. But in ASP.NET 2.0 there is a new attribute "&lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;requestLengthDiskThreshold&lt;/span&gt;&lt;/strong&gt;" in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;httpRunTime&lt;/span&gt; element in the web.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;config&lt;/span&gt; that specifies a disk buffer. Changing this to 8192 and you are done.&lt;/asp:fileupload&gt;&lt;/li&gt;&lt;li&gt;&lt;asp:fileupload runat="server"&gt;Make sure that ASP.NET account is enabled to write to the folder you want, simply open up Microsoft Windows Explorer and navigate to the folder to which you want to add this permission. Right-click on the folder and then select Properties. In the Properties dialog box, click on the Security tab and make sure the ASP.NET Machine Account is included in the list and has the proper permissions to write to disk.&lt;/asp:fileupload&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;&lt;strong&gt;Important Note:&lt;br /&gt;&lt;/strong&gt;This &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_18"&gt;attribute&lt;/span&gt; is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_19"&gt;available&lt;/span&gt; in 2.0 and above, &lt;/asp:fileupload&gt;&lt;asp:fileupload runat="server"&gt;The &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;RequestLengthDiskThreshold&lt;/span&gt;&lt;/strong&gt; property specifies the input-stream buffering threshold limit in number of bytes. Its value should not exceed the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;MaxRequestLength&lt;/span&gt;&lt;/strong&gt; property value. After a request entity exceeds this threshold, it is buffered transparently onto disk.&lt;br /&gt;With this, &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;fileupload&lt;/span&gt;&lt;/strong&gt; has improved a lot because the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;requestLengthDiskThreshold&lt;/span&gt; value sets the amount of the request that is cached in memory, and data beyond this value is temporarily written to disk. For more info on this please visit&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/h2e8928c.aspx" target="_blank"&gt;http://msdn2.microsoft.com/en-us/library/h2e8928c.aspx&lt;/a&gt;&lt;/asp:fileupload&gt;&lt;/p&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;Here is one more nice feature (progress bar) added to it&lt;br /&gt;&lt;a href="http://www.brettle.com/neatupload"&gt;http://www.brettle.com/neatupload&lt;/a&gt;&lt;/asp:fileupload&gt;&lt;/p&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;Have a look at the important node in web.config for the FileUpload control&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/e1f13641.aspx"&gt;http://msdn2.microsoft.com/en-us/library/e1f13641.aspx&lt;/a&gt;&lt;/asp:fileupload&gt;&lt;/p&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;For More details&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa479405.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa479405.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://aspnetresources.com/articles/discuss/dark_side_of_file_uploads.aspx"&gt;http://aspnetresources.com/articles/discuss/dark_side_of_file_uploads.aspx&lt;/a&gt;&lt;/asp:fileupload&gt;&lt;/p&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;&lt;br /&gt;In case if you any information here is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_24"&gt;wrong&lt;/span&gt; please feel free to write to me &lt;a href="mailto:Bharat.Mane@gmail.com"&gt;Bharat.Mane@gmail.com&lt;/a&gt;&lt;/asp:fileupload&gt;&lt;/p&gt;&lt;p&gt;&lt;asp:fileupload runat="server"&gt;&lt;/asp:fileupload&gt;&lt;asp:fileupload runat="server"&gt;Thank You&lt;br /&gt;&lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;Bharat&lt;/span&gt; Mane&lt;/strong&gt;&lt;/asp:fileupload&gt;&lt;asp:fileupload runat="server"&gt;&lt;strong&gt;&lt;/p&gt;&lt;/strong&gt;&lt;/asp:fileupload&gt;&lt;asp:fileupload runat="server"&gt;&lt;/asp:fileupload&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-7247169925735145339?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/7247169925735145339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=7247169925735145339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/7247169925735145339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/7247169925735145339'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2007/11/file-upload-in-aspnet-20.html' title='File Upload in ASP.NET 2.0'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-1688456714394927921</id><published>2007-10-26T05:11:00.000-07:00</published><updated>2007-10-26T05:33:51.860-07:00</updated><title type='text'>SQL Server 2005 sp_helptext change.</title><content type='html'>In the earlier version of MS &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SQL&lt;/span&gt; Server (Before &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SQL&lt;/span&gt; Server 2005) , the data in the system tables was visible to any user. But always it is good to have some other tools to view meta data.&lt;br /&gt;We were using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;sps&lt;/span&gt; such as to view the meta data/definition/script of the objects.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;sp&lt;/span&gt;_help&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;sp&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;helptext&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;But in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;SQL&lt;/span&gt; Server 2005 this will not work to any user unless it is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_7"&gt;explicitly&lt;/span&gt; specified. Here you will &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;receive&lt;/span&gt; an error&lt;/p&gt;&lt;p&gt;&lt;span style="color:#ff6666;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Msg&lt;/span&gt; 15009, Level 16, State 1, Procedure &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;sp&lt;/span&gt;_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;helptext&lt;/span&gt;, Line 54 &lt;/span&gt;&lt;/p&gt;&lt;p&gt;If you want it to work like &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_12"&gt;legacy&lt;/span&gt;, and does not want to restrict &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;metadata&lt;/span&gt; visibility, a new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;SQL&lt;/span&gt; Server 2005 permission can be used. The permission, VIEW DEFINITION, allows a user or role to see the definition of an object or all objects within a particular scope. The below mentioned &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;sql&lt;/span&gt; &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_16"&gt;statement&lt;/span&gt; can be used to do the same&lt;/p&gt;&lt;ul&gt;&lt;li&gt;GRANT VIEW ANY DEFINITION TO [user]&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;But be &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;careful&lt;/span&gt; while giving these kind of access to any users. Unless it is required do not GRANT such privileges&lt;/p&gt;&lt;p&gt;For more details please visit&lt;br /&gt;&lt;a href="http://www.microsoft.com/technet/technetmag/issues/2006/01/ProtectMetaData/"&gt;http://www.microsoft.com/technet/technetmag/issues/2006/01/ProtectMetaData/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;Bharat&lt;/span&gt; Mane&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-1688456714394927921?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/1688456714394927921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=1688456714394927921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/1688456714394927921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/1688456714394927921'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2007/10/sql-server-2005-sphelptext-change.html' title='SQL Server 2005 sp_helptext change.'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-8376619741184383344</id><published>2007-10-26T00:32:00.000-07:00</published><updated>2007-10-26T02:31:20.200-07:00</updated><title type='text'>ASP.NET 2.0 Menu Control Problem</title><content type='html'>ASP.NET 2.0 is bundelled with lots of new features. In older days we use to write lot of user controls now most common ones are coming as built in. Few of them are&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Master Pages &lt;/li&gt;&lt;li&gt;Menu Controls&lt;/li&gt;&lt;li&gt;Themes and Skins&lt;/li&gt;&lt;li&gt;Login Controls&lt;/li&gt;&lt;li&gt;Data Source Controls&lt;/li&gt;&lt;li&gt;Sitemap&lt;/li&gt;&lt;/ul&gt;This has made life of web programmer very easy. But while using them we need to be know about them throughly in order to get best out of it.&lt;br /&gt;&lt;br /&gt;We have used all of them listed above. And we have faced minor side effects of them as well.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here I am gogin to discuss on the Menu Control used in IE (as most of our users are using IE)&lt;br /&gt;Below mentioned problems I have faced in IE 6.0&lt;/p&gt;We have created an ASP.NET 2.0 web application. We have a few drop-down menus on this page. After clicking on the menu item which does a transaction that takes time, if we hover the mouse on other menu, the I.E browser’s progress bar completes immediately. However the transaction is happening in the background and will complete after a few minutes. But the user is in a state of confusion what is happening.For example you clicked on a menu and page is getting loaded then progress bar shows as below&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;a href="http://3.bp.blogspot.com/_c27i5O7J1oU/RyGbOp-1tAI/AAAAAAAAADY/OB_2Dlyg5oQ/s1600-h/progress1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5125548527014228994" style="CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_c27i5O7J1oU/RyGbOp-1tAI/AAAAAAAAADY/OB_2Dlyg5oQ/s400/progress1.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="left"&gt;But mean time if you move mouse over any menu the progress bar shows as below which indicates that thread aborted or completed. And this happens the moment you take mouse over to any menu it immediately fills the progress bar.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="center"&gt;&lt;a href="http://4.bp.blogspot.com/_c27i5O7J1oU/RyGcQ5-1tBI/AAAAAAAAADg/0h5IYdrnBio/s1600-h/progress2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5125549665180562450" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_c27i5O7J1oU/RyGcQ5-1tBI/AAAAAAAAADg/0h5IYdrnBio/s400/progress2.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;But reality is it just fills the progress bar and loding happes as expected. Here there is no problem with the functionality but with the usability.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The code responsible for the problem is emitted java script code present in the webresource.axd. Unfortunately we cannot change it. The PopOut_Show is the function causing the issue and it is a part of the call chain that is triggered by the onmouseover event.&lt;br /&gt;function PopOut_Show(panelId, hideScrollers, data) {&lt;br /&gt;//Code&lt;br /&gt;if (parent.tagName.toLowerCase() == "html") {&lt;br /&gt;document.body.appendChild(childFrame);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;parent.appendChild(childFrame);&lt;br /&gt;}&lt;br /&gt;//Code&lt;br /&gt;}&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In case if anybody has resolved this problem please let me know &lt;a href="mailto:bharat.mane@gmail.com"&gt;bharat.mane@gmail.com&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Bharat Mane&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-8376619741184383344?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/8376619741184383344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=8376619741184383344' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/8376619741184383344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/8376619741184383344'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2007/10/aspnet-20-menu-control-problem.html' title='ASP.NET 2.0 Menu Control Problem'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_c27i5O7J1oU/RyGbOp-1tAI/AAAAAAAAADY/OB_2Dlyg5oQ/s72-c/progress1.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-8907977243865255177</id><published>2007-10-24T23:58:00.000-07:00</published><updated>2007-10-26T02:21:58.077-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>Moving list Items from a List Box to another and Up or Down in same List Box</title><content type='html'>In most of the web pages we come accross a requirement of selecting multiple items form an list box. One of the best approach is to provide &lt;a href="http://4.bp.blogspot.com/_c27i5O7J1oU/RyBDNJ-1s9I/AAAAAAAAAC8/D9ueAT5mA8o/s1600-h/lstside.jpg"&gt;&lt;/a&gt;two list boxes as shown in the figure below&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://4.bp.blogspot.com/_c27i5O7J1oU/RyBDfJ-1s-I/AAAAAAAAADE/kstS-NJpC6c/s1600-h/lstside.jpg"&gt;&lt;/a&gt;&lt;/div&gt;&lt;p align="center"&gt;&lt;a href="http://2.bp.blogspot.com/_c27i5O7J1oU/RyBE3p-1s_I/AAAAAAAAADM/PNEtpkAEDRw/s1600-h/lstside.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5125172098900538354" style="CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_c27i5O7J1oU/RyBE3p-1s_I/AAAAAAAAADM/PNEtpkAEDRw/s400/lstside.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;Here user can easily select list items and move them back and forth. If we want improve the usability of your web page then we can provide following options&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;On DoubleClick of an item move it to the other list box.&lt;/li&gt;&lt;li&gt;On Enter key of an item move it to the other list box.&lt;/li&gt;&lt;li&gt;In some cases selected items may have oders so here we may need move up and down.&lt;/li&gt;&lt;li&gt;An increamental search for a list item can boost the usability to the web page.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Here is a common and simple function to move the list itesm&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//Where parameter are&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//src - id of Source Listbox Control &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//dest - id of Destination Listbox Control &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//strMessage - What message need to be displayed when listitem is not selected.&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//bFlag - true if all items to be moved and false if only seleted items to be moved&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:#6633ff;"&gt;function&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt; Move(src,dest,strMessage,bFlag)&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;var&lt;/span&gt; opt, o = 0; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;src = document.getElementById(src);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;dest = document.getElementById(dest);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Check is list box is empty&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(src.length&amp;lt;1)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;alert(strMessage + &lt;span style="color:maroon;"&gt;" is empty"&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Check are all items to be moved or not&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(bFlag)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;while&lt;/span&gt; (opt = src[0]) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; obj = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Option( src.options[0].text , src.options[0].value ) ;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;dest.options[dest.length] = obj&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;src[0] = &lt;span style="color:blue;"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Check if only selected items should be moved then whether any listitem is selected&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(src.selectedIndex == -1)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;alert(&lt;span style="color:maroon;"&gt;"Please select item from "&lt;/span&gt; + strMessage );&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Move all seleced list items&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;while&lt;/span&gt; (opt = src[o++]) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (opt.selected) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; obj = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Option( src.options[src.selectedIndex].text , src.options[src.selectedIndex].value ) ;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;dest.options[dest.length] = obj&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;src[o-1] = &lt;span style="color:blue;"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;o--;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;And here is a function which will handle keypress event&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//Where parameter are&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//src - id of Source Listbox Control &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//dest - id of Destination Listbox Control &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//strMessage - What message need to be displayed when listitem is not selected.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;function&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt; fnHandleKey(evt,src,dest,strMessage)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;evt = evt window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; keycode = evt.which ? evt.which : evt.keyCode;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(keycode == 13)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;Move(src,dest,strMessage,&lt;span style="color:blue;"&gt;false&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;And here is a function fot moving list items up/down&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//Moving Listitems Up/Down&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//Parameters&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//select - Object as ListBox &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//bFlag is true when you want to move down &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;//bFlag is false when you want to move up&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;function&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt; MoveUpDown(select,strMessage,bFlag)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;select = document.getElementById(select);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; i=0;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(bFlag)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt;(i=select.length-1;i&amp;gt;=0;i--)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(select.options[i].selected == &lt;span style="color:blue;"&gt;true&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; swapOption = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Object();&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//check whether selected option is last &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(i!=select.length-1)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Swap the positions of selected option and next option&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Copy all the propertis option to be moved &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;swapOption.text = select.options[i+1].text; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;swapOption.value = select.options[i+1].value; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;swapOption.selected = select.options[i+1].selected; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Replace the properties&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; property &lt;span style="color:blue;"&gt;in&lt;/span&gt; swapOption) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;select.options[i+1][property] = select.options[i][property]; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; property &lt;span style="color:blue;"&gt;in&lt;/span&gt; swapOption) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;select.options[i][property] = swapOption[property]; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt;(i=0;i&amp;lt;select.length;i++)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(select.options[i].selected == &lt;span style="color:blue;"&gt;true&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//check whether selected option is first&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(i!=0)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Swap the positions of selected option and next option&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Copy all the propertis option to be moved &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; swapOption = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Object(); &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;swapOption.text = select.options[i-1].text; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;swapOption.value = select.options[i-1].value; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;swapOption.selected = select.options[i-1].selected; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//Replace the properties&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; property &lt;span style="color:blue;"&gt;in&lt;/span&gt; swapOption) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;select.options[i-1][property] = select.options[i][property]; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; property &lt;span style="color:blue;"&gt;in&lt;/span&gt; swapOption) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;select.options[i][property] = swapOption[property]; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;To provide an incremental search on list box you will have to just add the behaviour to the select html tag or create a style for the select.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;This can be achieved by creating one HTC file and the code for the same is as below&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;/p&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;public&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;:&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;component&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;script&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&amp;lt;!--&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;/*------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;Event Handler Function&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;---------------------------------------------------*/&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;function&lt;/span&gt; setSelectedIndex()&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; obj = window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.srcElement;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(obj.type.toLowerCase().indexOf(&lt;span style="color:maroon;"&gt;'select'&lt;/span&gt;) == -1)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.keyCode == 27)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.selectedString = &lt;span style="color:maroon;"&gt;''&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.selectedIndex = -1;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;else&lt;/span&gt; &lt;span style="color:blue;"&gt;if&lt;/span&gt;(window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.keyCode == 9 window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.keyCode == 38 window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.keyCode == 40 window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.ctrlKey window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.altKey window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.type.toLowerCase() == &lt;span style="color:maroon;"&gt;'blur'&lt;/span&gt;) &lt;span style="color:green;"&gt;// tab, arrow-up, arrow-down, ctrl, or alt keys&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.selectedString = &lt;span style="color:maroon;"&gt;''&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:green;"&gt;//obj.fireEvent("change");&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(&lt;span style="color:blue;"&gt;typeof&lt;/span&gt; obj.selectedString == &lt;span style="color:maroon;"&gt;'undefined'&lt;/span&gt;) obj.selectedString = &lt;span style="color:maroon;"&gt;''&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.keyCode == 8) &lt;span style="color:green;"&gt;// backspace&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.selectedString = (obj.selectedString.length != 0) ? obj.selectedString.substring(0, obj.selectedString.length - 1) : &lt;span style="color:maroon;"&gt;''&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.selectedString = obj.selectedString + String.fromCharCode(window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.keyCode);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; newSelectedIndex = -1;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt;(&lt;span style="color:blue;"&gt;var&lt;/span&gt; i = 0; i &amp;lt; obj.options.length; i++)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(obj.options[i].text.toLowerCase().indexOf(obj.selectedString.toLowerCase()) == 0)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;newSelectedIndex = i;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;break&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;(newSelectedIndex != -1)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.selectedIndex = newSelectedIndex;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.selectedString = String.fromCharCode(window.&lt;span style="color:blue;"&gt;event&lt;/span&gt;.keyCode);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.fireEvent(&lt;span style="color:maroon;"&gt;"onchange"&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;obj.fireEvent(&lt;span style="color:maroon;"&gt;"onchange"&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:green;"&gt;// --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;script&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;public&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;:&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;attach&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt; &lt;span style="color:red;"&gt;event&lt;/span&gt;&lt;span style="color:blue;"&gt;="onkeydown"&lt;/span&gt; &lt;span style="color:red;"&gt;onevent&lt;/span&gt;&lt;span style="color:blue;"&gt;="setSelectedIndex()"/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;public&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;:&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;attach&lt;/span&gt;&lt;span style="font-family:'Courier New';"&gt; &lt;span style="color:red;"&gt;event&lt;/span&gt;&lt;span style="color:blue;"&gt;="onblur"&lt;/span&gt; &lt;span style="color:red;"&gt;onevent&lt;/span&gt;&lt;span style="color:blue;"&gt;="setSelectedIndex()"/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;public&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;:&lt;/span&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;component&lt;/span&gt;&lt;span style="font-family:'Courier New';color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;Now to acctach this behaviour to the select you can use where the above code is palced in "keydown.htc" and the class "selectIncSearch" is specified in the HTML file for the all the html select tags.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;/p&gt;&lt;span style="color:#ff0000;"&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';color:maroon;"&gt;.selectIncSearch&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:#000000;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;behavior&lt;/span&gt;&lt;span style="color:#000000;"&gt;:&lt;/span&gt;&lt;span style="color:blue;"&gt;url(keydown.htc)&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:'Courier New';"&gt;&lt;span style="color:#000000;"&gt;}&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;If you want to look at the complete sample please &lt;a href="http://bharat.mane.googlepages.com/MoveLstSample.zip"&gt;click here &lt;/a&gt;to download.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;In case of any problem or if the code is not functioning properly please feel free to write to me @ &lt;a href="mailto:bharat.mane@gmail.com"&gt;bharat.mane@gmail.com&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;&lt;/span&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-size:85%;color:#000000;"&gt;&lt;strong&gt;Bharat Mane&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-8907977243865255177?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/8907977243865255177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=8907977243865255177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/8907977243865255177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/8907977243865255177'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2007/10/moving-list-items-from-list-box-to.html' title='Moving list Items from a List Box to another and Up or Down in same List Box'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_c27i5O7J1oU/RyBE3p-1s_I/AAAAAAAAADM/PNEtpkAEDRw/s72-c/lstside.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-476654072865391162.post-5487478730519957400</id><published>2007-10-16T04:40:00.000-07:00</published><updated>2007-10-16T05:13:19.604-07:00</updated><title type='text'>SQL Object Search</title><content type='html'>While working with large database where there are hundreds of stored procedures, it is very difficult to do changes in schema. The schema change might cause chages in some or many stored procedures.&lt;br /&gt;&lt;br /&gt;In such case if we have simple query that gives all the procedure names that contains the given text.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINESWHERE ROUTINE_DEFINITION LIKE '%give the search string here%' AND ROUTINE_TYPE='PROCEDURE'&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The above query will give the list of the stored procedure name (along with the text) that contains the given string.&lt;br /&gt;&lt;br /&gt;This can be really handy when working with large database.&lt;br /&gt;&lt;br /&gt;Bharat&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/476654072865391162-5487478730519957400?l=bharatmane.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bharatmane.blogspot.com/feeds/5487478730519957400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=476654072865391162&amp;postID=5487478730519957400' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/5487478730519957400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/476654072865391162/posts/default/5487478730519957400'/><link rel='alternate' type='text/html' href='http://bharatmane.blogspot.com/2007/10/test-blog.html' title='SQL Object Search'/><author><name>Bharat Mane</name><uri>http://www.blogger.com/profile/12222813188217045297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_c27i5O7J1oU/R35-1v_qiBI/AAAAAAAAAE0/IQkREHDCUWk/S220/DSC038861.jpg'/></author><thr:total>1</thr:total></entry></feed>
