<?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-3455606985251406530</id><updated>2011-11-27T17:12:44.579-08:00</updated><title type='text'>C#.NET ASP.NET WPF WCF  LINQ SQL SERVER</title><subtitle type='html'>Interview Question and Articles</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-2859996408903489894</id><published>2010-08-03T09:39:00.000-07:00</published><updated>2010-08-03T09:39:22.756-07:00</updated><title type='text'>DotnetCharting Line Chart</title><content type='html'>&amp;lt;dotnet:Chart id="Chart_RTS_Count_Summary_by_Month_FY" runat="server"/&amp;gt;&lt;br /&gt;&lt;br /&gt;protected void splineRTSesChargesByMonth()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;// Set the chart type&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.Type = ChartType.Combo;&lt;br /&gt;&lt;br /&gt;// Set the size&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.Width = 1150;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.Height = 550;&lt;br /&gt;&lt;br /&gt;// Set the temp directory&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.TempDirectory = "temp";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.Debug = true;&lt;br /&gt;&lt;br /&gt;//Chart_RTS_Count_Summary_by_Month_FY.Title = "District RTSes Charges";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.LegendBox.Orientation = dotnetCHARTING.Orientation.Bottom;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.TitleBox.Position = TitleBoxPosition.FullWithLegend;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.DefaultElement.Marker.Visible = true;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.PaletteName = Palette.Five;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.ChartAreaSpacing = 8;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.LegendBox.Template = "%Icon%Name";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.TitleBox.Label.Font = new Font("", 12, FontStyle.Bold);&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.TitleBox.Label.Color = Color.Black;//FromArgb(39, 64, 139);//(0,104,139);&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.TitleBox.Background.Color = Color.FromArgb(215, 230, 250);//Color.WhiteSmoke;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.LegendBox.Background.Color = Color.WhiteSmoke;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.LegendBox.LabelStyle = new dotnetCHARTING.Label("", new Font("Arial", 10), Color.Black);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.XAxis.Label.Text = "Dates";&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.YAxis.Label.Text = "Invoice Amount";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.XAxis.TimeScaleLabels.Mode = TimeScaleLabelMode.Smart;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.XAxis.TimeScaleLabels.DayFormatString = "o";&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.XAxis.TimeScaleLabels.RangeIntervals.Add(TimeInterval.Month);&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.XAxis.TimeScaleLabels.MonthFormatString = "MMM";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SeriesCollection mySC = new SeriesCollection();&lt;br /&gt;&lt;br /&gt;Series s1 = new Series();&lt;br /&gt;&lt;br /&gt;Series s2 = new Series();&lt;br /&gt;&lt;br /&gt;Series s3 = new Series();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;&lt;br /&gt;ds = objBus.GetDTGRTSCountSummarybyMonthFY();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DataTable dt = ds.Tables[0];&lt;br /&gt;&lt;br /&gt;DataRow dr = dt.Rows[0];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (dr["title"].ToString().Length &amp;lt;= 0)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.Title = "District RTS Charges";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.Title = dr["title"].ToString();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;s1.Data = ds.Tables[0];&lt;br /&gt;&lt;br /&gt;s1.Type = SeriesType.Spline;&lt;br /&gt;&lt;br /&gt;s1.LegendEntry.Name = "RTS Charges($)";&lt;br /&gt;&lt;br /&gt;s1.Line.Width = 2;&lt;br /&gt;&lt;br /&gt;s1.YAxis = new Axis();&lt;br /&gt;&lt;br /&gt;s1.YAxis.FormatString = "Currency";&lt;br /&gt;&lt;br /&gt;//s1.YAxis.Minimum = 1750000;&lt;br /&gt;&lt;br /&gt;s1.YAxis.TickLabel.Color = Color.FromArgb(45, 24, 245);&lt;br /&gt;&lt;br /&gt;s1.YAxis.Label.Text = "RTS Charges($)";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;s2.Data = ds.Tables[1];&lt;br /&gt;&lt;br /&gt;s2.Type = SeriesType.Spline;&lt;br /&gt;&lt;br /&gt;s2.LegendEntry.Name = "Count";&lt;br /&gt;&lt;br /&gt;s2.Line.Width = 2;&lt;br /&gt;&lt;br /&gt;s2.YAxis = new Axis();&lt;br /&gt;&lt;br /&gt;s2.YAxis.TickLabel.Color = Color.FromArgb(245, 24, 55);&lt;br /&gt;&lt;br /&gt;//s2.YAxis.Minimum = 45000;&lt;br /&gt;&lt;br /&gt;s2.YAxis.Label.Text = "Count";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mySC.Add(s1);&lt;br /&gt;&lt;br /&gt;mySC.Add(s2); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mySC[0].DefaultElement.Color = Color.FromArgb(45, 24, 245);&lt;br /&gt;&lt;br /&gt;mySC[1].DefaultElement.Color = Color.FromArgb(245, 24, 55);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.DefaultElement.ShowValue = true;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.Mentor = false;&lt;br /&gt;&lt;br /&gt;Chart_RTS_Count_Summary_by_Month_FY.SeriesCollection.Add(mySC);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-2859996408903489894?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/2859996408903489894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=2859996408903489894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2859996408903489894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2859996408903489894'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/08/dotnetcharting-line-chart.html' title='DotnetCharting Line Chart'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-4696920591028697995</id><published>2010-06-16T13:44:00.001-07:00</published><updated>2010-06-16T14:13:48.634-07:00</updated><title type='text'>Advantages of jQuery</title><content type='html'>Advantages of jQuery&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. It’s lightweight, easy and fast.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Write less but do more.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Cross Browser Compatibility.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Separate javascript code from HTML mark-up.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Easy and Light-weight Ajax Application.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Availability of various plug-in’s.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. You can extend it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. We can use CDN (Content Distribution Network) for internet site.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9. Microsoft and Intellisense support in Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10. Easy Integration with ASP.Net Ajax projects.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Refer link&lt;br /&gt;&lt;a href="http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/"&gt;http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Referlink for webservices&lt;br /&gt;http://quickstarts.asp.net/QuickStartv20/webservices/doc/DataTypes.aspx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-4696920591028697995?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/4696920591028697995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=4696920591028697995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/4696920591028697995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/4696920591028697995'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/06/advantages-of-jquery.html' title='Advantages of jQuery'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-3926992817920095468</id><published>2010-06-16T07:08:00.000-07:00</published><updated>2010-06-16T07:08:14.437-07:00</updated><title type='text'>Consuming Webservices using ASP.Net AJAX</title><content type='html'>&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;head id="Head1" runat="server"&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;title&amp;gt;Consuming a Web Service Using ASP.NET Ajax&amp;lt;/title&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt; &lt;br /&gt;&lt;br /&gt;function pageLoad() { &lt;br /&gt;&lt;br /&gt;WebService.GetCustomerNames(onSuccess); &lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;function onSuccess(result) { &lt;br /&gt;&lt;br /&gt;var output = document.getElementById("Output"); &lt;br /&gt;&lt;br /&gt;output.innerHTML = result; &lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;function onFailure(result) { &lt;br /&gt;&lt;br /&gt;context.innerText = "Error Invoking the Web Service..."; &lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;body&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;Services&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;asp:ServiceReference Path="~/WebService.asmx" /&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/Services&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/asp:ScriptManager&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;div&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;span id="Output"&amp;gt;&amp;lt;/span&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/div&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/html&amp;gt; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;using System; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;&lt;br /&gt;using System.Web.Services;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;br /&gt;/// Summary description for WebService&lt;br /&gt;&lt;br /&gt;/// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;br /&gt;[WebService(Namespace = "http://tempuri.org/")]&lt;br /&gt;&lt;br /&gt;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;br /&gt;&lt;br /&gt;// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. &lt;br /&gt;&lt;br /&gt;[System.Web.Script.Services.ScriptService]&lt;br /&gt;&lt;br /&gt;public class WebService : System.Web.Services.WebService {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public WebService () {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Uncomment the following line if using designed components &lt;br /&gt;&lt;br /&gt;//InitializeComponent(); &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[WebMethod]&lt;br /&gt;&lt;br /&gt;public List&amp;lt;string&amp;gt; GetCustomerNames()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;List&amp;lt;String&amp;gt; customerList=new List&amp;lt;String&amp;gt;();&lt;br /&gt;&lt;br /&gt;customerList.Add("John");&lt;br /&gt;&lt;br /&gt;customerList.Add("Jacob");&lt;br /&gt;&lt;br /&gt;customerList.Add("Mary");&lt;br /&gt;&lt;br /&gt;customerList.Add("Peter");&lt;br /&gt;&lt;br /&gt;customerList.Add("Darren");&lt;br /&gt;&lt;br /&gt;return customerList;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-3926992817920095468?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/3926992817920095468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=3926992817920095468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/3926992817920095468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/3926992817920095468'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/06/consuming-webservices-using-aspnet-ajax.html' title='Consuming Webservices using ASP.Net AJAX'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-3668156541074770611</id><published>2010-06-15T14:00:00.001-07:00</published><updated>2010-06-15T14:00:43.746-07:00</updated><title type='text'>Consume webservices</title><content type='html'>Rate_WS.CurrencyConvertor ExRate = new Rate_WS.CurrencyConvertor(); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;lblEuroUsd.Text = ExRate.ConversionRate(Rate_WS.Currency.EUR, Rate_WS.Currency.USD).ToString(); &lt;br /&gt;&lt;br /&gt;lblINRUSD.Text = ExRate.ConversionRate(Rate_WS.Currency.INR, Rate_WS.Currency.USD).ToString(); &lt;br /&gt;&lt;br /&gt;lblInrEuro.Text = ExRate.ConversionRate(Rate_WS.Currency.INR, Rate_WS.Currency.EUR).ToString();&lt;br /&gt;&lt;br /&gt;lblUSDINR.Text = ExRate.ConversionRate(Rate_WS.Currency.USD, Rate_WS.Currency.INR).ToString(); &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Refer link http://www.dotnetspider.com/resources/30413-How-consume-third-Party-Web-service-C.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-3668156541074770611?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/3668156541074770611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=3668156541074770611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/3668156541074770611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/3668156541074770611'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/06/consume-webservices.html' title='Consume webservices'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-8130083046119012973</id><published>2010-06-15T13:11:00.001-07:00</published><updated>2010-06-15T13:11:53.301-07:00</updated><title type='text'>Search string in file</title><content type='html'>private void button1_Click(object sender, EventArgs e)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;string file = "C:\\Timesheet\\April\\Masoom_TS_04_09_2010.xls";&lt;br /&gt;&lt;br /&gt;string searchText = "Masoom";&lt;br /&gt;&lt;br /&gt;searchFile(file, searchText);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public void searchFile(String file, String searchText)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//Declare reader as a new StreamReader with file as the file to use &lt;br /&gt;&lt;br /&gt;System.IO.StreamReader reader = new System.IO.StreamReader(file);&lt;br /&gt;&lt;br /&gt;//Declare text as the reader reading to the end &lt;br /&gt;&lt;br /&gt;String text = reader.ReadToEnd();&lt;br /&gt;&lt;br /&gt;//If the searchText is a match &lt;br /&gt;&lt;br /&gt;if (System.Text.RegularExpressions.Regex.IsMatch(text, searchText))&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//Highlight the Text &lt;br /&gt;&lt;br /&gt;textBox1.Text = searchText;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//Show that it was not a match &lt;br /&gt;&lt;br /&gt;MessageBox.Show("Sorry, but " + searchText + " could not be found in the given file", "No Results");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-8130083046119012973?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/8130083046119012973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=8130083046119012973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/8130083046119012973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/8130083046119012973'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/06/search-string-in-file.html' title='Search string in file'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-1089475126778344619</id><published>2010-06-15T11:11:00.000-07:00</published><updated>2010-06-15T11:11:55.226-07:00</updated><title type='text'>Download File using ASP.net with C#</title><content type='html'>protected void btnSubmit_Click(object sender, EventArgs e)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Uri uri = new Uri(txtFilePath.Text);&lt;br /&gt;&lt;br /&gt;string LocalPath = string.Empty;&lt;br /&gt;&lt;br /&gt;LocalPath = "C:\\masoom";&lt;br /&gt;&lt;br /&gt;MyDownloadFile(uri, LocalPath);&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&amp;nbsp; &lt;br /&gt;public void MyDownloadFile(Uri url, string outputFilePath) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{ &lt;br /&gt;&amp;nbsp; &lt;br /&gt;try &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;const int BUFFER_SIZE = 16 * 1024;&lt;br /&gt;&lt;br /&gt;using (var outputFileStream = File.Create(outputFilePath, BUFFER_SIZE))&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;var req = WebRequest.Create(url);&lt;br /&gt;&lt;br /&gt;using (var response = req.GetResponse())&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;using (var responseStream = response.GetResponseStream())&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;var buffer = new byte[BUFFER_SIZE];&lt;br /&gt;&lt;br /&gt;int bytesRead;&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;bytesRead = responseStream.Read(buffer, 0, BUFFER_SIZE);&lt;br /&gt;&lt;br /&gt;outputFileStream.Write(buffer, 0, bytesRead);&lt;br /&gt;&lt;br /&gt;} while (bytesRead &amp;gt; 0);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;catch (Exception ex)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;throw ex;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&amp;nbsp; &lt;br /&gt;If credention required then add extra code on top of try block. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;string UserName = "masoom"; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;string SecurelyStoredPassword ="masoom"; &lt;br /&gt;&lt;br /&gt;string Domain = "ABC";&lt;br /&gt;&lt;br /&gt;CredentialCache myCache = new CredentialCache();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NetworkCredential netCredential = new NetworkCredential(UserName, SecurelyStoredPassword, Domain);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;myCache.Add(new Uri("http://netb.dcnet.in.dc.gov/wf/Files/Order_Management_System_User_Guide.pdf"), "Basic", netCredential);&lt;br /&gt;&lt;br /&gt;myCache.Add(new Uri("http://netb.dcnet.in.dc.gov/wf/Files/Order_Management_System_User_Guide.pdf"), "Digest", netCredential);&lt;br /&gt;&lt;br /&gt;myCache.Add(new Uri("http://netb.dcnet.in.dc.gov/wf/Files/Order_Management_System_User_Guide.pdf"), "Negotiate", netCredential);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-1089475126778344619?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/1089475126778344619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=1089475126778344619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/1089475126778344619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/1089475126778344619'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/06/download-file-using-aspnet-with-c.html' title='Download File using ASP.net with C#'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-1630730940158264932</id><published>2010-01-28T06:04:00.000-08:00</published><updated>2010-01-28T06:05:44.278-08:00</updated><title type='text'>Pie chart in DotnetCharting</title><content type='html'>protected void Pie_Billing_Charges()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;// Set the title.&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.Title = "Voice Services Charges by Service Type ";&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.Size = "550x320";&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.LegendBox.Position = LegendBoxPosition.None;&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.LegendBox.CornerTopRight = dotnetCHARTING.BoxCorner.Round;&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.DefaultElement.ShowValue = true;&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.TitleBox.Position = TitleBoxPosition.Full;&lt;br /&gt;&lt;br /&gt;// Set 3D&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.Use3D = true;&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.DefaultChartArea.ClearColors();&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.DefaultElement.SmartLabel.Text = "%name: %Value";&lt;br /&gt;&lt;br /&gt;//Chart_PieBillChrgs.LegendBox.Template = "%icon %name";&lt;br /&gt;&lt;br /&gt;// Set the chart Type&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.Type = ChartType.Pie;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Set default transparency&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.DefaultSeries.DefaultElement.Transparency = 15;&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.ShadingEffectMode = ShadingEffectMode.Five;&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.YAxis.FormatString = "Currency";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Set show value&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.DefaultSeries.DefaultElement.ShowValue = true;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Set labeling mode.&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.PieLabelMode = PieLabelMode.Outside;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Set the directory where the images will be stored.&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.TempDirectory = "temp";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SqlConnection conn = CreateConnection();&lt;br /&gt;&lt;br /&gt;if (conn!= null)&lt;br /&gt;&lt;br /&gt;conn.Open();&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;DataTable dt = new DataTable();&lt;br /&gt;&lt;br /&gt;SqlDataAdapter sda = new SqlDataAdapter(); &lt;br /&gt;&lt;br /&gt;sda.SelectCommand = new SqlCommand("select id,colvalue,colname from Billing where id = (select max(id) from Billing) order by colname", conn);&lt;br /&gt;&lt;br /&gt;sda.Fill(dt);&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.Series.Data = dt;&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.SeriesCollection.Add();&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.SeriesCollection[0].DefaultElement.Color = Color.FromArgb(49, 255, 49);&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.SeriesCollection[1].DefaultElement.Color = Color.FromArgb(255, 255, 0);&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.SeriesCollection[2].DefaultElement.Color = Color.FromArgb(255, 99, 49);&lt;br /&gt;&lt;br /&gt;Chart_PieBillChrgs.SeriesCollection[3].DefaultElement.Color = Color.FromArgb(0, 156, 255);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;catch (Exception ex)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;finally&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;conn.Close();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;dotnet:Chart id="Chart_PieBillChrgs" runat="server"/&amp;gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-1630730940158264932?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/1630730940158264932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=1630730940158264932' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/1630730940158264932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/1630730940158264932'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/01/pie-chart-in-dotnetcharting.html' title='Pie chart in DotnetCharting'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-5667818602998928738</id><published>2010-01-20T14:52:00.001-08:00</published><updated>2010-01-20T14:52:50.283-08:00</updated><title type='text'>when it was last updated table in sql server 2005/2008</title><content type='html'>&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update,*&lt;br /&gt;&lt;br /&gt;FROM sys.dm_db_index_usage_stats&lt;br /&gt;&lt;br /&gt;WHERE database_id = DB_ID( 'AdventureWorks')&lt;br /&gt;&lt;br /&gt;AND OBJECT_ID=OBJECT_ID('test')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Running query provides accurate details of when was the table last updated. If WHERE condition is entirely removed it will provide details of the entire database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-5667818602998928738?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/5667818602998928738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=5667818602998928738' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/5667818602998928738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/5667818602998928738'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/01/when-it-was-last-updated-table-in-sql.html' title='when it was last updated table in sql server 2005/2008'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-7876197478324407923</id><published>2010-01-19T14:09:00.001-08:00</published><updated>2010-01-19T14:09:39.244-08:00</updated><title type='text'>Telerik RadGrid with Paging</title><content type='html'>&amp;lt;telerik:RadPanelItem runat="server" Text="Action Log" Value="MasWFDetails" Expanded="true"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Items&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:RadPanelItem Value="WFDetails" runat="server"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ItemTemplate&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:RadGrid ID="RdWF" runat="server" AllowPaging="True" AllowSorting="True" ShowGroupPanel="true" GridLines="None" Skin="Office2007" AllowMultiRowSelection="True" OnNeedDataSource="RdWF_NeedDataSource" &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ClientSettings&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Selecting AllowRowSelect="True" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/ClientSettings&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;MasterTableView AutoGenerateColumns="false" NoMasterRecordsText="No Action History to display" &amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;Columns&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn HeaderText="Date" DataField="Date"&amp;gt;&amp;lt;/telerik:GridBoundColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn HeaderText="User" DataField="User"&amp;gt;&amp;lt;/telerik:GridBoundColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn HeaderText="Group" DataField="Group Name"&amp;gt;&amp;lt;/telerik:GridBoundColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn HeaderText="Action" DataField="Action"&amp;gt;&amp;lt;/telerik:GridBoundColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn HeaderText="Comments" DataField="Comments"&amp;gt;&amp;lt;/telerik:GridBoundColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Columns&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;AlternatingItemStyle CssClass="InnerAlernatingItemStyle" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/MasterTableView&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:RadGrid&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:RadPanelItem&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Items&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:RadPanelItem&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (!IsPostBack)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;BindGrid();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void BindGrid()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;RadGrid RdNotes = (RadGrid)SORadPanel.FindItemByValue("WFNotes").FindControl("RdNotes");&lt;br /&gt;&lt;br /&gt;if (RdNotes != null)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;RdNotes.DataSource = ds.Tables[3];&lt;br /&gt;&lt;br /&gt;RdNotes.DataBind();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;protected void RdNotes_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;RadGrid RdNotes = (RadGrid)SORadPanel.FindItemByValue("WFNotes").FindControl("RdNotes");&lt;br /&gt;&lt;br /&gt;string RTS = "";&lt;br /&gt;&lt;br /&gt;if (Session["INASCURRENTRTSCLICKED"] != null)&lt;br /&gt;&lt;br /&gt;RTS = Session["INASCURRENTRTSCLICKED"].ToString();&lt;br /&gt;&lt;br /&gt;if (RTS != "")&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;ds = objBus.getWFRTSDetails(RTS);&lt;br /&gt;&lt;br /&gt;RdNotes.DataSource = ds.Tables[4];&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// RdAttachment.DataSource = objBus.getDIDSODetails(tRTS.Text);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-7876197478324407923?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/7876197478324407923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=7876197478324407923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/7876197478324407923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/7876197478324407923'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/01/telerik-radgrid-with-paging.html' title='Telerik RadGrid with Paging'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-6529437186407234728</id><published>2010-01-14T06:21:00.000-08:00</published><updated>2010-01-14T06:30:52.519-08:00</updated><title type='text'>Telerik  RadGrid Batch update in DetailsTable on Selection of Checkbox</title><content type='html'>&lt;br /&gt;using Telerik.Web.UI;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public partial class UserGroupActionList : System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;string RTS = "";&lt;br /&gt;&lt;br /&gt;int roleId = 4;&lt;br /&gt;&lt;br /&gt;NASBusinessClass objBus = new NASBusinessClass(); &lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e) {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (Session["INASCURRENTRTSCLICKED"] != null)&lt;br /&gt;&lt;br /&gt;RTS = Session["INASCURRENTRTSCLICKED"].ToString();&lt;br /&gt;&lt;br /&gt;if (!IsPostBack)&lt;br /&gt;&lt;br /&gt;BindGrid();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Bind the Main Grid&lt;br /&gt;&lt;br /&gt;void BindGrid()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;DataTable dtGroup = objBus.getWorkflowGroupList();&lt;br /&gt;&lt;br /&gt;if (dtGroup.Rows.Count &amp;gt; 0)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;RdUserGroup.DataSource = dtGroup;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;protected void RdUserGroup_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (!e.IsFromDetailTable)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;RdUserGroup.DataSource = objBus.getWorkflowGroupList();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Bind the Nested Grid&lt;br /&gt;&lt;br /&gt;protected void RdUserGroup_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;&lt;br /&gt;&lt;br /&gt;if (e.DetailTableView.Name == "GroupAction")&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;int group_id = Convert.ToInt32(dataItem.GetDataKeyValue("Group_ID").ToString());&lt;br /&gt;&lt;br /&gt;DataTable dtUser = objBus.getActionsList(group_id, roleId);&lt;br /&gt;&lt;br /&gt;if (dtUser.Rows.Count &amp;gt; 0)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;e.DetailTableView.DataSource = dtUser;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;protected void RdUserGroup_ItemDataBound(object sender, GridItemEventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;GridTableView DetailsTable = (GridTableView)e.Item.OwnerTableView;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;foreach (GridCommandItem cmditm in RdUserGroup.MasterTableView.GetItems(GridItemType.CommandItem))&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Button btn1 = (Button)cmditm.FindControl("AddNewRecordButton");&lt;br /&gt;&lt;br /&gt;btn1.Enabled = false;&lt;br /&gt;&lt;br /&gt;btn1.Visible = false;&lt;br /&gt;&lt;br /&gt;//Disabling the LinkButton &lt;br /&gt;&lt;br /&gt;LinkButton lnkbtn1 = (LinkButton)cmditm.FindControl("InitInsertButton");&lt;br /&gt;&lt;br /&gt;lnkbtn1.Enabled = false;&lt;br /&gt;&lt;br /&gt;lnkbtn1.Visible = false; &lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void RdUserGroup_ItemCommand(object source, GridCommandEventArgs e)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;string groupId = string.Empty;&lt;br /&gt;&lt;br /&gt;if (e.Item.OwnerTableView.Name == "GroupAction")&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;GridTableView DetailsTable = (GridTableView)e.Item.OwnerTableView;&lt;br /&gt;&lt;br /&gt;groupId = DetailsTable.ParentItem.GetDataKeyValue("Group_ID").ToString();&lt;br /&gt;&lt;br /&gt;if (e.CommandName == "UpdateAll")&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;DeleteAll(groupId);&lt;br /&gt;&lt;br /&gt;UpdateAll(DetailsTable, groupId);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;catch (Exception ex)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lblError.Text = "";&lt;br /&gt;&lt;br /&gt;lblError.Visible = true;&lt;br /&gt;&lt;br /&gt;lblError.Text = "&amp;lt;font color='Red'&amp;gt;Unable to update" + ex.ToString();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void UpdateAll(GridTableView DetailsTable, string groupId)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;foreach (GridEditableItem dataItem in DetailsTable.Items)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//string actionName = string.Empty;&lt;br /&gt;&lt;br /&gt;int actionId = 0;&lt;br /&gt;&lt;br /&gt;int grpId = 0;&lt;br /&gt;&lt;br /&gt;grpId = Convert.ToInt32(groupId);&lt;br /&gt;&lt;br /&gt;Hashtable ht = new Hashtable();&lt;br /&gt;&lt;br /&gt;DetailsTable.ExtractValuesFromItem(ht, dataItem);&lt;br /&gt;&lt;br /&gt;//actionName = ht["Name"] .ToString(); &lt;br /&gt;&lt;br /&gt;CheckBox chkActionStatus = (CheckBox)dataItem.FindControl("chkActionStatus");&lt;br /&gt;&lt;br /&gt;actionId = Convert.ToInt32(ht["Action_id"].ToString());&lt;br /&gt;&lt;br /&gt;if (chkActionStatus != null)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (chkActionStatus.Checked)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;int success = objBus.UpdateGroupActionsList(grpId, actionId, roleId); &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;GridHeaderItem headerItem = DetailsTable.GetItems(GridItemType.Header)[0] as GridHeaderItem;&lt;br /&gt;&lt;br /&gt;//headerItem["Name"].BorderColor = System.Drawing.Color.Red;&lt;br /&gt;&lt;br /&gt;headerItem["Name"].Text = "&amp;lt;font size='3'&amp;gt;&amp;lt;B&amp;gt;Updated Actions Successfully&amp;lt;/B&amp;gt;&amp;lt;/font&amp;gt;"; &lt;br /&gt;&lt;br /&gt;//Response.Write("&amp;lt;script language='javascript'&amp;gt;alert('Edit Successfull');&amp;lt;/script&amp;gt;");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void DeleteAll(string groupId)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;int grpId=0;&lt;br /&gt;&lt;br /&gt;grpId=Convert.ToInt32(groupId);&lt;br /&gt;&lt;br /&gt;int success = objBus.DeleteGroupActionsList(grpId);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:RadGrid ID="RdUserGroup" runat="server" PageSize="25" AllowPaging="True" AllowSorting="True" ShowGroupPanel="true" &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;GridLines="None" Width="900px" Skin="Office2007" OnItemCommand="RdUserGroup_ItemCommand" OnItemDataBound="RdUserGroup_ItemDataBound" OnNeedDataSource="RdUserGroup_NeedDataSource" OnDetailTableDataBind="RdUserGroup_DetailTableDataBind" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowMultiRowSelection="True" &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ClientSettings&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Selecting AllowRowSelect="True" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/ClientSettings&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" Name="Group" EditMode="InPlace" NoMasterRecordsText="No Group to display" HierarchyLoadMode="Client" DataKeyNames="Group_ID" &amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;DetailTables&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridTableView CssClass="DetailTable" Name="GroupAction" NoDetailRecordsText="No Action to display" Width="550px" AllowAutomaticUpdates="true" AutoGenerateColumns="false" CommandItemDisplay="Bottom" CommandItemStyle-HorizontalAlign="Center" CommandItemSettings-RefreshText=""&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;HeaderStyle CssClass="InnerHeaderStyle"&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/HeaderStyle&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;CommandItemStyle CssClass="InnerCommandStyle"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;CommandItemTemplate&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Button runat="server" ID="UpdateAll" Text="Save Changes" CommandName="UpdateAll" /&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Button runat="server" ID="CancelAll" Text="Cancel" CommandName="CancelAll" /&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/CommandItemTemplate&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;Columns&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridEditCommandColumn Visible="false"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:GridEditCommandColumn&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn headertext="Action Name" datafield="Name" /&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridTemplateColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:CheckBox ID="chkActionStatus" runat="server" Checked='&amp;lt;%# Eval("chkstatus").ToString() == "1" %&amp;gt;' /&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:GridTemplateColumn&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn headertext="Action_id" datafield="Action_id" Visible="false" /&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/Columns&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:GridTableView&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/DetailTables&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Columns&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridTemplateColumn HeaderText="Group_ID" UniqueName="Group_ID" SortExpression="Group" Visible="false"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Label ID="lblGroupID" runat="server" Text='&amp;lt;%# DataBinder.Eval(Container.DataItem,"Group_ID")%&amp;gt;'&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/ItemTemplate&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:GridTemplateColumn&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn DataField="Group_Name" HeaderText="Group Name" UniqueName="Group" &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:GridBoundColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;telerik:GridBoundColumn DataField="Description" HeaderText="Group Description" UniqueName="Group_Descn" &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:GridBoundColumn&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/Columns&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;AlternatingItemStyle CssClass="InnerAlernatingItemStyle" /&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;/MasterTableView&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/telerik:RadGrid&amp;gt; &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-6529437186407234728?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/6529437186407234728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=6529437186407234728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/6529437186407234728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/6529437186407234728'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/01/telerik-radgrid-batch-update-in.html' title='Telerik  RadGrid Batch update in DetailsTable on Selection of Checkbox'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-2506921049922544487</id><published>2010-01-12T05:54:00.001-08:00</published><updated>2010-01-12T05:54:34.452-08:00</updated><title type='text'>GridView Radio Button find and Selection</title><content type='html'>&lt;br /&gt;foreach (GridViewRow grdrows in gviewInternalOrder.Rows)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;RadioButton rdb;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rdb = (RadioButton)grdrows.FindControl("rdbSelect");&lt;br /&gt;&lt;br /&gt;if (rdb != null)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (rdb.Checked == true)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lblError.Text = ""; &lt;br /&gt;&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;lblError.Text = "";&lt;br /&gt;&lt;br /&gt;lblError.Visible = true;&lt;br /&gt;&lt;br /&gt;lblError.Text = "Select Radio Button";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-2506921049922544487?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/2506921049922544487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=2506921049922544487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2506921049922544487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2506921049922544487'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/01/gridview-radio-button-find-and.html' title='GridView Radio Button find and Selection'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-4897144082219767295</id><published>2010-01-12T05:50:00.000-08:00</published><updated>2010-01-12T05:51:03.835-08:00</updated><title type='text'>GridView LinkButton with HyperLink</title><content type='html'>protected void gviewInternalOrder_RowDataBound(object sender, GridViewRowEventArgs e)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (e.Row.RowType == DataControlRowType.DataRow)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;LinkButton lnkrts = (LinkButton)e.Row.FindControl("lnkView");&lt;br /&gt;&lt;br /&gt;if (lnkrts != null &amp;amp;&amp;amp; e.Row.Cells[2].Text != "")&lt;br /&gt;&lt;br /&gt;lnkrts.Attributes.Add("onclick", "window.open('../WF/RTSDetailView.aspx?RTS=" + e.Row.Cells[2].Text + "');");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-4897144082219767295?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/4897144082219767295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=4897144082219767295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/4897144082219767295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/4897144082219767295'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2010/01/gridview-linkbutton-with-hyperlink.html' title='GridView LinkButton with HyperLink'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-367348676670293009</id><published>2009-12-16T13:42:00.000-08:00</published><updated>2009-12-16T13:42:32.362-08:00</updated><title type='text'>Tips to improve the performance of your web application.</title><content type='html'>&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;o:smarttagtype name="PlaceType" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype name="PlaceName" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype name="place" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;1. Viewstate&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;View state is wonder mechanism which shows the details ofentry which posted on the server. Every time its get loaded from the server.This option looks like extra feature for the end users. This needs to be loadedfrom the server and it adds more size to the page But it will affect theperformance when we have many controls in the page like user registration. So,if it is no need then it can be disabled.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;EnableViewState = "false" needs to be given basedon the requirement. It can be given at the control, page and config levelsettings.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;2. Avoid Session andApplication Variables&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Session is storage mechanism which helps the developers totake the value across the pages. It will be stored based on the session statechosen. By default it will be stored in the Inproc. That default settings usesthe IIS. When use this Session variable in a page, which is accessed by manynumbers then it will occupy more memory allocation and gives addition overheadto the IIS. It will make the slow performance.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Most of thescenarios it can be avoided. If you want to send the information across thepages then we can use Cross Post back, Query string with encrypted. If you wantto store the information with in the page, then cache object is best way.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;3. Use Caching&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;ASP.Net has the very significant feature of cachingmechanism. It gives more performance and avoids the client/server process.There are three types of caching in ASP.Net.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;If there is any static content in the full pages then itshould be used the Output cache. What it does, it stores the content on IIS.When the page is request it will load immediately from the IIS for the certainperiod of time. Similarly Fragment paging can be used for store the part of webpage.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;4. Effectively useCSS and Script files&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;If you have big CSS files which used for the entire sitedifferent pages, then based on the requirement it can be spitted and storedwith different names. It will minimize the loading time of the pages.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;5. Images sizes&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Over use of images in the web site affect the web page performance.It takes time to load the images especially on dial up connections. Instead ofusing the background images, it can be achieved on the CSS colors or use lightweight images to repeat in the entire pages.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;6. CSS based layout&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The entire web page design controlled by the CSS using thediv tags instead of table layout. It increases the page loading performancedramatically. It will help to enforce same standard guideline throughout thewebsite. It will reduce the future changes easily. When we use the nested tablelayout it takes more time for rendering.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;7. Avoid Round trips&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;We can avoid unnecessary database hits to load the unchangedcontent in the database. We should use IsPostBack method to avoid round tripsto database.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;8. Validate usingJavaScript&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Manual validation can be done at the client browser insteadof doing at the server side. The JavaScript help us to do the validation at theclient side. This will reduce the additional overhead to the server.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The plug-in software helps to disable the coding in theclient browser. So, the sensitive application should to the server sidevalidation before go into the process.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;9. Clear the GarbageCollection&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Normally .Net application use the Garbage collection toclean the unused the resources from the memory. But it takes own time to clearthe unused objects from the memory.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;There are lots of ways to clean the unused the resource. Butnot all the methods recommended. But we can use dispose method in the finallyblock to clean the resources. More over we have to close the connection. Itwill immediately free the resources and gives spaces in the memory.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;10. Avoid bulk datastore on client side&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Try to avoid more data on the client side. It will affectthe web page loading. When we store more data on the hidden control then itwill encrypt and store on the client side. It can be tamper by hackers as well.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;11. Implement DynamicPaging&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;When we load bulk number of records in server data controlslike GridView, DataList, and ListView it will take time to load. So we can showonly the current page data through the dynamic paging.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;12. Use StoredProcedure&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Try to use stored procedure maximum. It will increase theperformance of the web pages. Because it is stored as complied object in thedatabase and it uses the query execution plans. If you pass the query then itwill make network query. In the stored procedure single line will be passed tothe backend.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;13. Use XML and XSLT&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;XML and XSLT will speed up the page performance. If theprocess is not more complex then it can be implemented in XSLT.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;14. Use Dataset&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The DataSet is not light weight when compare withDataReader. But it has the advantages of disconnected oriented architecture.The DataSet will consume lot of memory. Even though it can have more than oneday. If you want to perform many operations while loading the page itself, thenyou can better go with DataSet. Once data is loaded into DataSet then it can beused later also.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;15. Use StringBuilder in place of String&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;When we append the strings like mail formatting in serverside, then we can use String Builder. If you use string for concatenation, whatit does every time it create the new storage location for place that string. Itoccupies more spaces in memory. But if we use String Builder class in C# itconsumes more memory space than String.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;16. UseServer.Transfer&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;If you want to transfer the page with in the current serverthen we can use the Server.Transfer method. It avoids roundtrips between thebrowser and server. But it won't update the browser history.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;17. Use Threads&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Thread is important mechanism in the programming language toutilize the system resources effectively. When we want to do background processthen it can be called as background process.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Consider an example, when click on send, it should sends themail to 5 lakhs members that time no need to wait for all the processcompletion. Just call the mail sending process as background thread then goahead for the further process. Because this mail sending not depend on the anyother process.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;18. &lt;st1:place w:st="on"&gt;&lt;st1:placename w:st="on"&gt;Disable&lt;/st1:placename&gt; &lt;st1:placename w:st="on"&gt;Session&lt;/st1:placename&gt; &lt;st1:placetype w:st="on"&gt;State&lt;/st1:placetype&gt;&lt;/st1:place&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;st1:place w:st="on"&gt;&lt;st1:placename w:st="on"&gt;Disable&lt;/st1:placename&gt; &lt;st1:placename w:st="on"&gt;Session&lt;/st1:placename&gt; &lt;st1:placetype w:st="on"&gt;State&lt;/st1:placetype&gt;&lt;/st1:place&gt;if you’re not going to use it.&amp;nbsp; Bydefault it’s on. You can actually turn this off for specific pages, instead offor every page:&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;lt;%@ Page language="c#"Codebehind="WebForm1.aspx.cs"&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AutoEventWireup="false"Inherits="WebApplication1.WebForm1"&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnableSessionState="false"%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;You can also disable it across the application in theweb.config by setting the &amp;lt;sessionState&amp;gt; mode value to Off.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;19. Output Buffering&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Take advantage of this great feature.&amp;nbsp; Basically batch all of your work on theserver, and then run a Response.Flush method to output the data.&amp;nbsp; This avoids chatty back and forth with theserver.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%response.buffer=true%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then use:&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;%response.flush=true%&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;20. Avoid Server-SideValidation&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Try to avoid server-side validation, use client-sideinstead. Server-Side will just consume valuable resources on your servers, andcause more chat back and forth.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;21. Repeater ControlGood,&amp;nbsp; DataList, DataGrid, and DataViewcontrols Bad&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Asp.net is a great platform, unfortunately a lot of thecontrols that were developed are heavy in html, and create not the greatestscaleable html from a performance standpoint.&amp;nbsp;ASP.net&amp;nbsp; repeater control isawesome!&amp;nbsp; Use it!&amp;nbsp; You might write more code, but you will thankme in the long run!&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;22. Take advantage ofHttpResponse.IsClientConnected before performing a large operation:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Response.IsClientConnected)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // If still connected,redirect&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // to anotherpage. &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect("Page2CS.aspx",false);&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What is wrong withResponse.Redirect? Read on&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;23. UseHTTPServerUtility.Transfer instead of Response.Redirect&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Redirects are also very chatty.&amp;nbsp; They should only be used when you aretransferring people to another physical web server.&amp;nbsp; For any transfers within your server, use.transfer!&amp;nbsp; You will save a lot ofneedless HTTP requests.&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;24. Always checkPage.IsValid when using Validator Controls&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;So you’ve dropped on some validator controls, and you thinkyour good to go because ASP.net does everything for you!&amp;nbsp; Right? Wrong!&amp;nbsp;All that happens if bad data is received is the IsValid flag is set tofalse. So make sure you check Page.IsValid before processing your forms!&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;25. Deploy withRelease Build&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Make sure you use Release Build mode and not Debug Buildwhen you deploy your site to production. If you think this doesn’t matter,think again.&amp;nbsp; By running in debug mode,you are creating PDB’s and cranking up the timeout.&amp;nbsp; Deploy Release mode and you will see thespeed improvements.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;26. Turn off Tracing&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Tracing is awesome, however have you remembered to turn itoff? If not, make sure you edit your web.config and turn it off!&amp;nbsp; It will add a lot of overhead to yourapplication that is not needed in a production environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;traceenabled="false" pageOutput="false" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;traceenabled="false" requestLimit="10"pageOutput="false" traceMode="SortByTime"localOnly="true"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;compilationdebug="false" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;27. Page.IsPostBackis your friend&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;Make sure you don’texecute code needlessly. I don’t know how many web developers forget aboutchecking IsPostBack!&amp;nbsp; It seems like sucha basic thing to me!&amp;nbsp; Needlessprocessing!&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;28. Avoid Exceptions&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Avoid throwing exceptions, and handling useless exceptions.Exceptions are probably one of the heaviest resource hogs and causes ofslowdowns you will ever see in web applications, as well as windows applications.&amp;nbsp; Write your code so they don’t happen!&amp;nbsp; Don’t code by exception!&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;29. Caching is possiblythe number one tip!&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Use Quick Page Caching and the ASP.net Cache API!&amp;nbsp; Lots to learn, its not as simple as you mightthink.&amp;nbsp; There is a lot of strategyinvolved here.&amp;nbsp; When do you cache?&amp;nbsp; what do you cache?&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;30. CreatePer-Request Cache&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Use HTTPContect.Items to add single page load to create aper-request cache.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;31. StringBuilder&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;StringBuilder.Append is faster than String + String.&amp;nbsp; However in order to use StringBuilder, youmust&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newStringBuilder()&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Therefore it is not something you want to use if you don’thave large strings.&amp;nbsp; If you areconcatenating less than 3 times, then stick with String + String. You can alsotry String.Concat&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;32. Turn offViewState&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;If you are not usingform postback, turn off viewsate, by default, controls will turn on viewsateand slow your site.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; publicShowOrdersTablePage()&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Init += newEventHandler(Page_Init);&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private voidPage_Init(object sender, System.EventArgs e)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.EnableViewState= false;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;33. Use Paging&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Take advantage of paging’s simplicity in .net. Only showsmall subsets of data at a time, allowing the page to load faster.&amp;nbsp; Just be careful when you mix in caching.&amp;nbsp; How many times do you hit the page 2, or page3 button?&amp;nbsp; Hardly ever right!&amp;nbsp; So don’t cache all the data in the grid!Think of it this way: How big would the first search result page be for “music”on Google if they cached all the pages from 1 to goggle &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;34. Use theAppOffline.htm when updating binaries&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;I hate the genericasp.net error messages!&amp;nbsp; If I never hadto see them again I would be so happy.&amp;nbsp;Make sure your users never see them!&amp;nbsp;Use the AppOffline.htm file!&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;35. Use ControlStateand not ViewState for Controls&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;If you followed the last tip, you are probably freaking outat the though of your controls not working.&amp;nbsp;Simply use &lt;st1:place w:st="on"&gt;&lt;st1:placename w:st="on"&gt;Control&lt;/st1:placename&gt; &lt;st1:placetype w:st="on"&gt;State&lt;/st1:placetype&gt;&lt;/st1:place&gt;.&amp;nbsp; Microsoft has an excellent example of usingControlState here, as I will not be able to get into all the detail in thisshort article.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;36. Use the FinallyMethod&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;If you have opened any connections to the database, orfiles, etc, make sure that you close them at the end!&amp;nbsp; The Finally block is really the best place todo so, as it is the only block of code that will surely execute.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;37. Option Strict andOption Explicit&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;This is an oldy, andnot so much a strictly ASP.net tip, but a .net tip in general.&amp;nbsp; Make sure you turn BOTH on.&amp;nbsp; You should never trust .net or any compilerto perform conversions for you.&amp;nbsp; That’sjust shady programming, and low quality code anyway.&amp;nbsp; If you have never turned both on, go turn themon right now and try and compile.&amp;nbsp; Fixall your errors.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-367348676670293009?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/367348676670293009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=367348676670293009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/367348676670293009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/367348676670293009'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/tips-to-improve-performance-of-your-web.html' title='Tips to improve the performance of your web application.'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-2665097120372886108</id><published>2009-12-16T13:14:00.000-08:00</published><updated>2009-12-16T13:17:28.753-08:00</updated><title type='text'>When should use struct</title><content type='html'>&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face	{font-family:"Trebuchet MS";	panose-1:2 11 6 3 2 2 2 2 2 4;	mso-font-charset:0;	mso-generic-font-family:swiss;	mso-font-pitch:variable;	mso-font-signature:647 0 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}pre	{margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;	font-size:10.0pt;	font-family:"Courier New";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;1. Structare value type and stored on stack while class are reference type and store onheap.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;2. Structdo not support inheritance while class supports inheritance, However struct canimplements interface.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;3. Structshould be used when you want to use a small data structure while class isbetter choice for complex data structure.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;span style="color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;4. The fourth significant difference between class objects andstruct objects refers to constructors. Constructors are supported by structs inthe C# language, and you can define constructors for structs in exactly thesame manner as you would for classes. If you are not familiar withconstructors, they are methods with the same name as the struct or class.However, &lt;b&gt;the only exception with struct constructors is that you are notpermitted to define a constructor that takes no arguments&lt;/b&gt;. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;b&gt;&lt;span style="color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;5. &lt;i&gt;By default, Structure data members are public but class datamembers are private.&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;6. In Structure we can’t declare any default constructorexplicitly because it provides by .net framework. But in class we can declaredefault constructor explicitly.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;7. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;It is not mandatory to initialize all Fields inside theconstructor of a class. But all the Fields of a struct must be fullyinitialized inside the constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;8. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;Struct object is allocated in the stack, and the class object isallocated in the heap.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;Now, Struct are good for simplethings like Point, which would have an int/float for each dimension which couldbe 2-3 dimension, or a set of variables which don't change through out...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;On the other hand, classes are usedto have multiple instances of the set Of variables (any others) , but structalways have a single set.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 12pt;"&gt;Lets say ,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 12pt;"&gt;you need&amp;nbsp; keep x, y co-ordinate information, to this struct is best other than class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;Struct Point&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int x;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int y;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Point(int x, int y)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.x = x;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.y = y;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Point Add(Point pt)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point newPt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newPt.x = x + pt.x;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newPt.y = y + pt.y;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return newPt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;Class:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;for example you need employee detail.so that time class is best choice other than struct.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;public class Employee&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string address;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-2665097120372886108?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/2665097120372886108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=2665097120372886108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2665097120372886108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2665097120372886108'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/when-should-use-struct.html' title='When should use struct'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-6122936845457043434</id><published>2009-12-13T14:48:00.000-08:00</published><updated>2009-12-13T14:53:31.283-08:00</updated><title type='text'>SQL Server Reporting Services General Topics</title><content type='html'>&lt;b&gt;&lt;br /&gt;1: How to migrate SQL Server 2008 Reporting Services to another computer?&lt;/b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color: black;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color: black;"&gt;Themigration process for Reporting Services includes manual and automatedsteps. The following tasks are part of a report server migration:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Back up database, application, and configuration files.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Back up the encryption key.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Installa new instance of SQL Server 2008. If you are using the same hardware,you can install SQL Server 2008 side-by-side your existing SQL Server2000 or 2005 installation. Be aware that if you do this, you might needto install SQL Server 2008 as a named instance.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Movethe report server database and other application files from your SQLServer 2000 or 2005 installation to your new SQL Server 2008installation.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Move any custom application files to the new installation.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Configure the report server.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Edit RSReportServer.config to include any custom settings from your previous installation.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;8.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Optionally, configure custom Access Control Lists (ACLs) for the new Reporting Services Windows service group.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;9.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Test your installation.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span style="color: black;"&gt;&lt;span style="font-size: 11pt;"&gt;10.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;Remove unused applications and tools after you have confirmed that the new instance is fully operational.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color: black;"&gt;Ifyou are reusing an existing report server database that you created ina previous installation, be aware that there are restrictions on theeditions of SQL Server you use to host the report server database.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span style="color: #1f497d; font-size: 12pt;"&gt;&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;2: How to combine connecting string via parameter?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;/b&gt;You can include parameter referencein the data source connection string and allow the user to choose adata source for the report. For example, with an expression-basedconnection string, a user who is running a sales report can select adata source for a particular county before running the report.&lt;br /&gt;The following example illustrates the use of a data sourceexpression in a SQL Server connection string. The example assumes youhave created a report parameter named ServerName:&lt;br /&gt;="Data Source=" &amp;amp; Parameters! ServerName.Value &amp;amp; "; initial catalog=AdventureWorks" &lt;br /&gt;&lt;br /&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;&lt;span style="color: black; font-size: 12pt;"&gt;3: Error of EXECUTE permission denied on object 'xp_sqlagent_notify'.&lt;/span&gt;&lt;span lang="EN-GB" style="color: #1f497d; font-size: 12pt;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Problem:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;In some special cases, you may receive the following error when trying to select the option execution from a report:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;EXECUTE permission denied on object 'xp_sqlagent_notify', database '######', schema '###'.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;Cause:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Usually, this error is caused by the user missing the "RSExecRole" role in the Master and MSDB system databases. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Solution:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;ReportingServices uses a predefined database role called "RSExecRole" to grantreport server permissions to the report server database. If you get theerror mentioned above, try to create and provision the &amp;nbsp;"RSExecRole"role in Master and MSDB system database.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="color: black; margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;b&gt;&lt;span style="color: black; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;4: How to enable anonymous access to Report Server, and is there any security consideration?&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #1f497d; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: #1f497d; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-GB" style="color: #1f497d; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Pleasenote that when using anonymous access, every person accesses thereports under the anonymous user context, and no one will have rightsto administer Reporting Services through Report Manager.&amp;nbsp;This is thereason why it is not recommended to use anonymous access in ReportingServices.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Inorder to differentiate between users, we need to either disableanonymous access or use a custom security extension.&amp;nbsp; We have a sampleusing Forms Authentication:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left; vertical-align: top;"&gt;&lt;span lang="EN-GB"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa902691%28SQL.80%29.aspx"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color: blue; font-family: Calibri;"&gt;Using Forms Authentication in Reporting Services&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Insome special situations, it may be necessary to use anonymous access.For security considerations, we can use the steps as below:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;1.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Add the anonymous user to the System User role&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;2.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Createan Item-level role with all of the tasks you want this user to be ableto use, and then assign the anonymous user to that role at the rootlevel.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;3.&lt;span style="font-family: 'Times New Roman'; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Check permissions for the anonymous user on folders that SRS uses:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;For example: &lt;br /&gt;C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services&amp;nbsp; (and subfolders)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;C:\&amp;lt;windows&amp;gt;\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;The temp folder for the anonymous user&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Note&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;:Step1 &amp;amp; Step2 can be accomplished through Report Manager only ifanonymous access is disabled and the logged-on user is a member of theSystem Administrator role.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;b&gt;&lt;span style="color: #1f497d; font-size: 12pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;5: How to create a custom report template in Reporting Services?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Areport template also exists as a normal report (RDL file). If you wantto customize your own report templates, you can put the previouslyprepared reports (which will be used as new templates) in a specificfolder. By default, the path is:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Then,to use these templates, you can right click on the Reports folder inyour project and select New Item. You will then see the name of thereport templates you added in the above folder.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="color: black; margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;6: Does SQL Server 2005 Reporting Services support horizontal tables which have fixed rows and dynamic columns?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;Note:&lt;/b&gt; This Q&amp;amp;A is only for &amp;nbsp;SQL Server 2005 Reporting Services.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;By default, there is no native "horizontal table" report item. We can use Matrix to simulate simple horizontal tables:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;1.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add a matrix to your report.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;2.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add static rows to the matrix: Right-click in the Data cell and select "Add Row".&amp;nbsp; Repeat for the number of fixed rows you want.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;3.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Drag fields into the Data cells:&lt;br /&gt;&lt;br /&gt;You'llnotice that the design tool automatically wraps your field reference inthe "First" aggregate (e.g. =First(Fields!City.Value)).&amp;nbsp; Since you'redoing this in the context of a matrix, the design tool is ensuring thatthe expression is meaningful even in the context of a subtotal or ifthe matrix is showing aggregated data rather than detail data.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Note: Please do NOT remove the aggregate expression.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;4.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add a column grouping:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;br /&gt;&lt;span style="font-family: Calibri;"&gt;1) Right-click on the column header and select "Edit Group".&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;2)Enter this for the group expression: =RowNumber(Nothing). This willcause the matrix to give you one column per row of data. Sincehorizontal tables can end up rather wide, you may want your table wraparound to the next "line" after a specific number of columns.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;5.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add a list to your report and drag the table into it.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;6.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Group by a number of rows:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;1) Right-click on the list and select Properties.&amp;nbsp; Then click on Edit Details Group.&lt;br /&gt;2) Enter this for the group expression: =Ceiling(RowNumber(Nothing)/3)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;This will cause the list to group on every three rows.&amp;nbsp; So you'll get a separate table for every three rows.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;7.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Adjust the group expression in the matrix:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Editthe column group expression in your matrix and change the RowNumberargument to be the list group name. For example:=RowNumber("list1_Details_Group")&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="color: black; margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;7: How to reset the page number back to 1 every time the report gets a group break?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span lang="EN-GB" style="color: #1f497d; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span style="color: #1f497d; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="color: black; font-size: 11pt;"&gt;Resetting&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;the page number on group breaks is not natively supported. There is aworkaround: you can track group breaks in a shared variable, and resetthis variable to 1 when reaches a new group break.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Here are the steps:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;1.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Make sure there's a textbox in the report which contains the group expression.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;2.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add shared variables to track the current group and page offset:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Shared offset as Integer&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Shared currentgroup as Object&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;3.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Add a custom function to set the shared variables and retrieve the group page number:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Public Function GetGroupPageNumber(group as Object, pagenumber as Integer) as Object&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; If Not (group = currentgroup)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&amp;nbsp; offset = pagenumber - 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&amp;nbsp; currentgroup = group&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; End If&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; Return pagenumber - offset&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;End Function&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt 0.25in; text-align: left; text-indent: -0.25in;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;4.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Use the function in the page header or footer:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;=Code.GetGroupPageNumber(ReportItems!Category.Value,Globals!PageNumber)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="color: black; margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;8: How to open the drill- through report in a new browser window?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="margin: 0in 0in 0pt; text-align: left; text-indent: 0in;"&gt;&lt;span lang="EN-GB" style="color: #1f497d; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Generally,if you use the "Jump to URL" option for a textbox, it will redirect tothe specific URL in the same browser when the user clicks on thetextbox. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;To open the link in a new window, you can use syntax similar to this:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span lang="EN-GB" style="color: black; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;=&lt;span style="color: #a31515;"&gt;"javascript:void window.open ('http://servername/reportserver?/frepor&lt;/span&gt;&lt;/pre&gt;&lt;div align="left" class="MsoListParagraph" style="color: black; margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="color: black; margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;9: How to verify the version of SQL Server?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;There are a few ways to verify the version of SQL Server. &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Method1. You can run a query "SELECT @@VERSION" and note the version numberreturned in the string. SQL Server 2005 SP1 would return something likethe following:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sep 22 2006 23:44:32&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Copyright (c) 1988-2005 Microsoft Corporation&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Method 2. you can also look at the file version for sqlservr.exe.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Method3. If you look in Add\Remove Programs, you would also see an entry forService Pack 1 for SQL Server &amp;lt;component name&amp;gt;. Each patchedcomponent would have its own entry. Please note that you will need toselect the "Show Updates" check box in the Add\Remove Programs dialog.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Method 4. You can check the registry keys and values under:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Thereare several other areas that contain version information. Sharedcomponents generally have a Setup sub-key under"HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\90\&amp;lt;Component&amp;gt;". For example:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;...\90\DTS\Setup&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;...\90\Tools\Setup&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;...\90\NS\Setup&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Thenfor each instance of SQL\Analysis Services\Reporting Services, you canlook under the instance specific key. These keys are numbered asMSSQL.x (where x is the instance number). These are created in theorder of installation. So if you have only a single instance of SQLServer, the instance key would be MSSQL.1. Under each instance keyyou'll find a Setup key as well.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;In all cases, the Setup sub-key contains a value of PatchLevel, which equals the version of the instance. &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;For example, for SQL Server 2005 RTM, the value should be 9.0.1399, and SP1 would be 9.0.2047.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: black; margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;10: How to use multiple datasets?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;You can combine two or more datasets in one report. There are multiple options to achieve this:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style="font-size: x-small;"&gt;·&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt;"&gt;If the data comes from different tables in the same database, join the datasets based on a common key present in both tables.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style="font-size: x-small;"&gt;·&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt;"&gt;Use the Linked Server functionality.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left; vertical-align: middle;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left; vertical-align: middle;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt;"&gt;For more information, see &lt;/span&gt;&lt;span lang="EN-GB"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa213283%28SQL.80%29.aspx"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="color: blue;"&gt;Accessing External Data&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 27pt; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style="font-size: x-small;"&gt;·&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt;"&gt;Use the OpenRowSet functionality to join data from another database server into the current query.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="color: black; margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;11: How to upgrade report from SQL Server 2000 to SQL Server 2005?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="color: black; font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;You can use the following steps:&lt;/span&gt;&lt;br /&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Back up ReportServer and ReportServerTemDB.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Back up encryption keys from Reporting services 2000 by using RsKeyMgmt.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Restore the databases backed up from step 1.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Connect to newly restored databases from step 3 from Reporting Services 2005 Configuration manager and database setup.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;By using the provided credentials, Reporting Services will connect to new databases and perform the upgrade operations. &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Confirm Reporting services upgrading the database and granting adequate rights to the credential account.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Restore backed up keys from step 2. Confirm that everything is displayed as green now.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;b style="color: black;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;12: Out of memory error when exporting reports to Excel.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span lang="EN-GB" style="color: #1f497d; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Problem:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;We may encounter Out of memory error when exporting reports to Excel.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Cause:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Generally, this kind problem is complicated. There are some possible factors that may cause this issue:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;1.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;On the x86 platform using the /3GB switch, the OS makes about 1.8 GB (maximum) available to be shared by all applications. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;2.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;The.NET Framework 1.1/2.0 supports the use of the /3GB switch. However, itmust share the OS-imposed limit of approximately 1.8 GB memory. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;3.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Usingthe /3GB switch cuts down the amount non-paged pool (NPP) memoryHTTP.SYS (a kernel-mode driver IIS 6.0) uses to manage its connections,to 128 MB from 250 MB. This could negatively impact performance of IIS,should other sites be hosted on the server. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;4.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;NETapplications (of which SSRS is one) typically encounter out-of-memoryissues at approximately 1.1 GB (+/- a wide margin, depending on manyfactors). &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;5.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;SSRS currently uses in-memory data caching and rendering; a “streaming” design &lt;br /&gt;needed to process extremely large reports simply does not exist at this time. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; vertical-align: middle;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Solution:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;You may try the following suggestions first:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;1.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt;"&gt;Please refer to this KB: &lt;/span&gt;&lt;span lang="EN-GB"&gt;&lt;a href="http://support.microsoft.com/kb/909678"&gt;&lt;span lang="EN-US" style="color: blue; font-size: 11pt;"&gt;You may receive the "&lt;b&gt;System.OutOfMemoryException&lt;/b&gt;" error message when you use SQL Server Reporting Services&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;2.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Break the report to get smaller amount of data.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;3.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;You can try using a 64-bit machine which doesn't have limitation of 2GB of usermode space.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;4.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt;"&gt;Youcan test /3GB switch (of course not recommended on a production server)which allows to allocate 1GB to Kernel mode and 3GB to user mode.&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-GB"&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/927bfe25-1705-4b60-91d4-2ed64d6aa85f.mspx"&gt;&lt;span lang="EN-US" style="color: blue; font-size: 11pt;"&gt;http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/927bfe25-1705-4b60-91d4-2ed64d6aa85f.mspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;5.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;span style="font-size: 11pt;"&gt;Ingeneral the 3GB switch should be used only for testing purposes sincethis setting shrinks the available address space for the Kernel mode.Below is a KB article that briefly talks about this:&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-GB"&gt;&lt;a href="http://support.microsoft.com/kb/291988"&gt;&lt;span lang="EN-US" style="color: blue; font-size: 11pt;"&gt;A description of the 4 GB RAM Tuning feature and the Physical Address Extension &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span lang="EN-GB"&gt;&lt;a href="http://support.microsoft.com/kb/291988"&gt;&lt;span lang="EN-US" style="color: blue; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;switch&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; text-indent: -0.25in; vertical-align: middle;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;6.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Ensure that the Memory recycling checkboxes are unchecked for the SSRS app pool in IIS.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt 0.75in; text-align: left; vertical-align: middle;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;Note:&lt;/b&gt; Excel rendering is improved in the Reporting Services 2008 and this issue may not occur in Reporting Services 2008.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="color: black; margin: 0in 0in 0pt; text-align: left;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;13: How to improve PDF quality of the report exported in Reporting Services 2005?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;span style="color: #1f497d; font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;ThePDF renderer in Reporting Services 2005 resizes all images that it isgiven at 96 DPI no matter what DPI the image is when you pass it to therenderer. That means that a 300 DPI image or even a 600 DPI image willbe sized in the PDF as if it is only 96 DPI. In other words, your highDPI image may render larger than expected.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Despitesizing the images as if they were 96 DPI, the PDF renderer appears torender higher DPI images at a higher quality than 96 DPI. Even if thesizing being wrong, the image actually is rendering at a higher quality.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Anecessary workaround is to size the image to the proper number ofinches based on 96 DPI calculations. Then use Bitmap.SetResolution toset the&amp;nbsp; images to at least 300 DPI.&amp;nbsp; That mayprovide a higher quality image that is the proper number of pixels tofit properly in the report.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoListParagraph" style="color: black; margin: 0in 0in 0pt 21pt; text-align: left; text-indent: -21pt;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;b&gt;14: How to enable the Select All option for a multi-value parameter?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: #1f497d; font-size: 12pt;"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Problem:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Whena user defines an available values list for a multi-value parameter, aSelect ALL option on the report parameter drop-down list automaticallyappears. However, if you don’t want to make the parameter multi-value,how to enable the Select All option for the query parameter? &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Solution:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Sincethe single-value query parameter does not provide the Select Alloption, you cannot query the data without any limitations. Sometimes,the end user may want to ignore the condition for the parameterizedquery. In this case, you can add the "Select All" option to theparameter dataset by using SQL statement. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Here are the detailed steps:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol style="margin-top: 0in;" type="1"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Create a dataset for the parameter using the following query string:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;SELECT ‘ALL’ &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;UNION ALL &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;SELECT Field from table&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol style="margin-top: 0in;" type="1"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Edit your base dataset query:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;The original query:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;… AND Field=@Parameter…&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Change it to this:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;…AND (( Field=@Parameter ))OR(@Parameter=’ALL’))…&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol style="margin-top: 0in;" type="1"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;Set the report parameter.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;1) Set the available values as the field created in Step 1.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 11pt;"&gt;&lt;span style="font-family: Calibri;"&gt;2) Set the default value of parameter to All.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" class="MsoNormal" style="margin: 0in 0in 0pt; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-6122936845457043434?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/6122936845457043434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=6122936845457043434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/6122936845457043434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/6122936845457043434'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/sql-server-reporting-services-general.html' title='SQL Server Reporting Services General Topics'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-3060939592009971425</id><published>2009-12-13T14:28:00.000-08:00</published><updated>2010-06-03T19:15:32.315-07:00</updated><title type='text'>SQL Server Reporting Services(SSRS) Interview Questions</title><content type='html'>&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 1. Explain the flow from a report request to report delivery.&lt;/span&gt;&lt;br style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;" /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 2. Where does connection string of a report exists? Can we read it?&lt;/span&gt;&lt;br style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;" /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 3. Where does reporting services stands as a BI tool compared to BO, Cognos, Crystal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reports,&amp;nbsp;&amp;nbsp;&amp;nbsp; Hyperion etc?&lt;/span&gt;&lt;br style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;" /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 4. What is Subreport control used for?&lt;/span&gt;&lt;br style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;" /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 5. What is the difference between Matrix control &amp;amp; Table control?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: Trebuchet MS;"&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSRS provide table and matrix control to let user populate data in different scenario. Table control let user to populate simple format of data where fixed columns applied and rows grow dynamically. Matrix provide more powerful features where it columns and rows can be dynamically grow. In that case, writing a store procedure to support a matrix become easier in some scenarios.&lt;/b&gt;&lt;br /&gt;This solution seems pretty simple and straight forward. However, this will only work fines if you have small set of record in your tables. If you have hundred thousand of records with &amp;gt;20 type of products in your table, this solution no longer perfect. You will be facing performance issues. Yes, Matrix control very slow when deal with large amount of data.&lt;br /&gt;So far, I don’t see any other solutions except convert it to table control. However, converting to table control required rewrite on the source SP. This seems a bit difficult but actually can be done via sample SP below:&lt;br /&gt;Using Matrix Control, I can’t get my report after waiting for an hour. However, with the new query using table control, I manage to get my result within 5 minutes. So, think carefully before using matrix control&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 6. What are the different aggregate functions available in SSRS?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 7. How to change the format of the currency field?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 8. What are report parameters?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; 9. What are the different types of parameters used in SSRS, explain each one of them.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 10. How to add a cascading parameter to a report?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 11. How to create a drilldown report? Explain the steps.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 12. How to add page breaks in a report?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 13. What is data driven subscription? How to implement this?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 14. What services in windows need to run for SSRS to run properly?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 15. What is the report history in SSRS manager means? How to enable history?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 16. Explain the security architecture of SSRS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 17. Mention some of the in built security roles in SSRS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;, sans-serif;"&gt;&amp;nbsp; 18. Why do we use Reporting services configuration manager tool? What are the tasks we&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; achieve in this?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-3060939592009971425?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/3060939592009971425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=3060939592009971425' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/3060939592009971425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/3060939592009971425'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/sql-server-reporting-servicesssrs.html' title='SQL Server Reporting Services(SSRS) Interview Questions'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-7090226368975737080</id><published>2009-12-06T21:25:00.000-08:00</published><updated>2009-12-06T21:25:11.806-08:00</updated><title type='text'>C# Interview Question</title><content type='html'>&lt;strong&gt;&lt;span style="font-size: medium;"&gt;General Questions&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;Does C# support multiple-inheritance?&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;No.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Who is a protected class-level variable available to?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;It is available to any sub-class (a class inheriting this class).&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Are private class-level variables inherited?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Yes, but they are not accessible.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Although they are not visible or accessible via the class interface, they are inherited.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Describe the accessibility modifier “protected internal”.&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;It is available to classes that are within the same assembly and derived from the specified&amp;nbsp;base class.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;strong&gt;&lt;span&gt;What’s the top .NET class that everything is derived from?&lt;/span&gt; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;System.Object.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;What does the term immutable mean?&lt;/strong&gt;&lt;br /&gt;The data value may not be changed.&amp;nbsp; Note: The &lt;em&gt;variable&lt;/em&gt; value may be changed, but the original immutable data value was discarded and a new data value was created in memory.&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;What’s the difference between System.String and System.Text.StringBuilder classes?&lt;/strong&gt;&lt;br /&gt;System.String is immutable.&lt;span&gt;&amp;nbsp; &lt;/span&gt;System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What’s the advantage of using System.Text.StringBuilder over System.String?&lt;/strong&gt;&lt;br /&gt;StringBuilder is more efficient in cases where there is a large amount of string manipulation.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Strings are immutable, so each time a string is changed,&amp;nbsp;a new instance in memory is created.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Can you store multiple data types in System.Array?&lt;/strong&gt;&lt;br /&gt;No.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?&lt;br /&gt;&lt;/strong&gt;TheClone() method returns a new array (a shallow copy) object containingall the elements in the original array.&amp;nbsp; The CopyTo() method copies theelements into another existing array.&amp;nbsp; Both perform a shallow copy.&amp;nbsp; Ashallow copy means the contents (each array element) containsreferences to the same object as the elements in the original array.&amp;nbsp; Adeep copy (which neither of these methods performs) would create a newinstance of each element's object, resulting in a different, yetidentacle object.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;How can you sort the elements of the array in descending order?&lt;br /&gt;&lt;/strong&gt;By calling Sort() and then Reverse() methods.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What’s the .NET collection&amp;nbsp;class that allows an element to be accessed using a unique key?&lt;br /&gt;&lt;/strong&gt;HashTable.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What class is underneath the SortedList class?&lt;br /&gt;&lt;/strong&gt;A sorted HashTable.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Will the finally block get executed if an exception has not occurred?­&lt;br /&gt;&lt;/strong&gt;Yes. &lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What’s the C# syntax to catch any possible exception?&lt;br /&gt;&lt;/strong&gt;Acatch block that catches the exception of type System.Exception.&amp;nbsp; Youcan also omit the parameter data type in this case and just write catch{}.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Can multiple catch blocks be executed for a single try statement?&lt;br /&gt;&lt;/strong&gt;No.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Once the proper catch block processed, control is transferred to the finally block (if there are any).&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;strong&gt;Explain the three services model commonly know as a three-tier application.&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;Class Questions&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What is the syntax to inherit from a class in C#?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Place a colon and then the name of the base class.&lt;br /&gt;Example: &lt;em&gt;class MyNewClass : MyBaseClass&lt;/em&gt;&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Can you prevent your class from being inherited by another class?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Yes.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The keyword “sealed” will prevent the class from being inherited.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Can you allow a class to be inherited, but prevent the method from being over-ridden?&lt;br /&gt;&lt;/strong&gt;Yes.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Just leave the class public and make the method sealed.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What’s an abstract class?&lt;br /&gt;&lt;/strong&gt;A class that cannot be instantiated. &lt;span&gt;&amp;nbsp;&lt;/span&gt;An abstract class is a class that must be inherited and have the methods overridden. &lt;span&gt;&amp;nbsp;&lt;/span&gt;An abstract class is essentially a blueprint for a class without any implementation.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;When do you absolutely have to declare a class as abstract?&lt;/strong&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden. &lt;br /&gt;2.&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;When at least one of the methods in the class is abstract.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What is an interface class?&lt;br /&gt;&lt;/strong&gt;Interfaces,like classes, define a set of properties, methods, and events. Butunlike classes, interfaces do not provide implementation. They areimplemented by classes, and defined as separate entities from classes.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Why can’t you specify the accessibility modifier for methods inside the interface?&lt;br /&gt;&lt;/strong&gt;They all must be public, and are therefore public by default.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Can you inherit multiple interfaces?&lt;br /&gt;&lt;/strong&gt;Yes.&amp;nbsp; .NET does support multiple interfaces.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What happens if you inherit multiple interfaces and they have conflicting method names?&lt;br /&gt;&lt;/strong&gt;It’sup to you to implement the method inside your own class, soimplementation is left entirely up to you. This might cause a problemon a higher-level scale if similarly named methods from differentinterfaces expect different data, but as far as compiler cares you’reokay. &lt;br /&gt;&lt;strong&gt;To Do:&lt;/strong&gt; Investigate&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What’s the difference between an interface and abstract class?&lt;br /&gt;&lt;/strong&gt;In an interface class, all methods are abstract - there is no implementation.&lt;span&gt;&amp;nbsp; &lt;/span&gt;In an abstract class some methods can be concrete. &lt;span&gt;&amp;nbsp;&lt;/span&gt;In an interface class, no accessibility modifiers are allowed.&amp;nbsp; An abstract class may have accessibility modifiers.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;strong&gt;What is the difference between a Struct and a Class?&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Structsare value-type variables and are thus saved on the stack, additionaloverhead but faster retrieval.&amp;nbsp; Another difference is that structs&amp;nbsp;&lt;strong&gt;cannot&lt;/strong&gt; inherit.&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;Method and Property Questions&lt;/span&gt;&lt;/strong&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What’s the implicit name of the parameter that gets passed into the set method/property of a class?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Value.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The data type of the value parameter is defined by whatever data type the property is declared as.&lt;a href="" name="more55"&gt;&lt;/a&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What does the keyword “virtual” declare for a method or property?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;The method or property can be overridden.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;How is method overriding different from method overloading?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;When overriding a method, you change the behavior of the method for the derived class.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Overloading a method simply involves having another method with the same name within the class.&lt;span&gt;&lt;span&gt;&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Can you declare an override method to be static if the original method is not static?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;No.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The signature of the virtual method must remain the same.&amp;nbsp; (Note: Only the keyword virtual is changed to keyword override)&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;What are the different ways a method can be overloaded? &lt;br /&gt;&lt;/strong&gt;Different parameter data types, different number of parameters, different order of parameters.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;If a base class has a number of overloadedconstructors, and an&amp;nbsp;inheriting class has a number of overloadedconstructors; can you enforce a call from an inherited constructor to aspecific base constructor?&lt;br /&gt;&lt;/strong&gt;Yes, just place a colon, andthen keyword base (parameter list to invoke the appropriateconstructor) in the overloaded constructor definition inside theinherited class.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;Events and Delegates&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What’s a delegate?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;A delegate object encapsulates a reference to a method.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What’s a multicast delegate?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;A delegate that has multiple handlers assigned to it.&amp;nbsp; Each assigned handler (method) is called.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;XML Documentation Questions &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Is XML case-sensitive?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;Yes.&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What’s the difference between // comments, /* */ comments and /// comments?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Single-line comments, multi-line comments, and XML documentation comments.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;How do you generate documentation from the C# file commented properly with a command-line compiler?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Compile it with the /doc switch.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;Debugging and Testing Questions &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;What debugging tools come with the .NET SDK?&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;1.&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;CorDBG – command-line debugger.&lt;span&gt;&amp;nbsp; &lt;/span&gt;To use CorDbg, you must compile the original C# file using the /debug switch. &lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;2.&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;DbgCLR – graphic debugger. &lt;span&gt;&amp;nbsp;&lt;/span&gt;Visual Studio .NET uses the DbgCLR.&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What does assert() method do?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. &lt;span&gt;&amp;nbsp;&lt;/span&gt;The program proceeds without any interruption if the condition is true.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What’s the difference between the Debug class and Trace class?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;Documentation looks the same. &lt;span&gt;&amp;nbsp;&lt;/span&gt;Use Debug class for debug builds, use Trace class for both debug and release builds.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Why are there five tracing levels in System.Diagnostics.TraceSwitcher?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;The tracing dumps can be quite verbose.&lt;span&gt;&amp;nbsp; &lt;/span&gt;For applications that are constantly running you run the risk of overloading the machine and the hard drive. &lt;span&gt;&amp;nbsp;&lt;/span&gt;Five levels range from None to Verbose, allowing you to fine-tune the tracing activities.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;Where is the output of TextWriterTraceListener redirected?&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span&gt;To the Console or a text file depending on the parameter passed to the constructor.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;How do you debug an ASP.NET Web application?&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span&gt;Attach the aspnet_wp.exe process to the DbgClr debugger.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What are three test cases you should go through in unit testing?&lt;/span&gt; &lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;1.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Positive test cases (correct data, correct output).&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;2.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Negative test cases (broken or missing data, proper handling).&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;3.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Exception test cases (exceptions are thrown and caught properly).&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;Can you change the value of a variable while debugging a C# application?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;Yes.&lt;span&gt;&amp;nbsp; &lt;/span&gt;If you are debugging via Visual Studio.NET, just go to Immediate window.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;ADO.NET and Database Questions &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;span&gt;&lt;span&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What is the role of the DataReader class in ADO.NET connections?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;Itreturns a read-only, forward-only rowset from the data source.&amp;nbsp; ADataReader provides fast access when a forward-only sequential read isneeded.&lt;/span&gt;&lt;/li&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;SQLServer.NETdata provider is high-speed and robust, but requires SQL Server licensepurchased from Microsoft. OLE-DB.NET is universal for accessing othersources, like Oracle, DB2, Microsoft Access and Informix.&lt;span&gt;&amp;nbsp; &lt;/span&gt;OLE-DB.NET is a .NET layer on top of the OLE layer, so it’s not as fastest and efficient as SqlServer.NET.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What is the wildcard character in SQL?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;Let’s say you want to query database with LIKE for all employees whose name starts with &lt;st1:place w:st="on"&gt;&lt;st1:state w:st="on"&gt;La.&lt;/st1:state&gt; &lt;/st1:place&gt;The wildcard character is %, the proper query with LIKE would involve ‘La%’.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;Explain ACID rule of thumb for transactions.&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;A transaction must be:&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;1.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Atomic - it is one unit of work and does not dependent on previous and following transactions.&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;2.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Consistent - data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t.&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;3.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Isolated - no transaction sees the intermediate results of the current transaction).&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;4.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Durable - the values persist if the data had been committed even if the system crashes right after.&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What connections does Microsoft SQL Server support?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password).&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span&gt;WindowsAuthentication is trusted because the username and password are checkedwith the Active Directory, the SQL Server authentication is untrusted,since SQL Server is the only verifier participating in the transaction.&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;What does the Initial Catalog parameter define in the connection string?&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span&gt;The database name to connect to.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What does the Dispose method do with the connection object?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span&gt;Deletes it from the memory.&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;To Do:&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;span&gt;&lt;span&gt;answer better.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The current answer is not entirely correct.&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;What is a pre-requisite for connection pooling?&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;Multipleprocesses must agree that they will share the same connection, whereevery parameter is the same, including the security settings.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The connection string must be identical.&lt;br /&gt;&amp;nbsp;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;Assembly Questions &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;How is the DLL Hell problem solved in .NET?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;Assemblyversioning allows the application to specify not only the library itneeds to run (which was available under Win32), but also the version ofthe assembly.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What are the ways to deploy an assembly?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;An MSI installer, a CAB archive, and XCOPY command.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;strong&gt;What is a satellite assembly?&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;Whenyou write a multilingual or multi-cultural application in .NET, andwant to distribute the core application separately from the localizedmodules, the localized assemblies that modify the core application arecalled satellite assemblies.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;What namespaces are necessary to create a localized application?&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;System.Globalization and System.Resources.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What is the smallest unit of execution in .NET?&lt;/strong&gt;&lt;br /&gt;an Assembly.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;When should you call the garbage collector in .NET?&lt;/strong&gt;&lt;br /&gt;Asa good rule, you should not call the garbage collector.&amp;nbsp; However,you&amp;nbsp;could call the garbage collector when you are done using a largeobject (or set of objects) to force the garbage collector to dispose ofthose very large objects from memory.&amp;nbsp; However, this is usually not agood practice.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;How do you convert a value-type to a reference-type?&lt;/strong&gt;&lt;br /&gt;Use Boxing.&lt;br /&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt;&lt;strong&gt;What&amp;nbsp;happens in memory when you&amp;nbsp;Box and Unbox a value-type?&lt;/strong&gt;&lt;br /&gt;Boxingconverts&amp;nbsp;a value-type to a reference-type, thus storing the object onthe heap.&amp;nbsp; Unboxing converts a reference-type to a value-type, thusstoring the value on the stack.&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-7090226368975737080?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/7090226368975737080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=7090226368975737080' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/7090226368975737080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/7090226368975737080'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/c-interview-question.html' title='C# Interview Question'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-9025638279080114632</id><published>2009-12-05T20:12:00.000-08:00</published><updated>2009-12-06T01:06:33.142-08:00</updated><title type='text'>Net Data Structures</title><content type='html'>&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face	{font-family:"Trebuchet MS";	panose-1:2 11 6 3 2 2 2 2 2 4;	mso-font-charset:0;	mso-generic-font-family:swiss;	mso-font-pitch:variable;	mso-font-signature:647 0 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}code	{font-family:"Courier New";	mso-ascii-font-family:"Courier New";	mso-fareast-font-family:"Times New Roman";	mso-hansi-font-family:"Courier New";	mso-bidi-font-family:"Courier New";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;Array&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt; - represents an old-school memory array -kind of like a alias for a normal &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;type[]&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;array. Can enumerate. Can't grow automatically. I would assume very fastinsertion and retriv. speed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;ArrayList&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt; - automatically growing array. Adds moreoverhead. Can enum., probably slower than a normal array but still pretty fast.These are used a lot in .NET&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;List&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt; - one of my favs - can be used withgenerics, so you can have a strongly typed array, e.g. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;List&amp;lt;string&amp;gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;. Other than that, acts very much like &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;ArrayList&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;Hashtable&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt; - plain old hashtable. O(1) to O(n) worstcase. Can enumerate the value and keys properties, and do key/val pairs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;Dictionary&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt; - same as above only strongly typed viagenerics, such as &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;Dictionary&amp;lt;string,string&amp;gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;SortedList&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt; - a sorted generic list. Slowed oninsertion since it has to figure out where to put things. Can enum., probablythe same on retrieval since it doesn't have to resort, but deletion will beslower than a plain old list.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;I tend to use &lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;List&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;b&gt; &lt;/b&gt;and &lt;/span&gt;&lt;b&gt;&amp;lt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;Dictionary&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;b&gt; &lt;/b&gt;all the time - once you start using themstrongly typed with generics, its really hard to go back to the standardnon-generic ones.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;There are lots of other datastructures too - there's &lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;KeyValuePair&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;b&gt;&lt;/b&gt;which you can use to do some interesting things, there's a &lt;/span&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;"&gt;SortedDictionary&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;b&gt; &lt;/b&gt;which can be useful as well.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="post-text" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;If at all possible, use generics.&lt;/b&gt;  This includes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;List instead of ArrayList&lt;/li&gt;&lt;li&gt;Dictionary instead of HashTable&lt;/li&gt;&lt;li&gt;List is a generic implementation of ArrayList.  &lt;/li&gt;&lt;li&gt;Dictionary is a generic implementation of Hashtable.&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Arrays are a fixed size collection that you can change the value stored at a given index. &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;SortedDictionary is an IDictionary that is sorted based on the keys.SortedList is an IDictionary that is sorted based on a required IComparer.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;So, the IDictionary implementations (those supporting KeyValuePairs) are:* Hashtable* Dictionary* SortedList* SortedDictionary&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Another collection that was added in .NET 3.5 is the &lt;b&gt;Hashset&lt;/b&gt;.  It is a collection that supports set operations.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Also, the LinkedList is a standard linked-list implementation (the List is an array-list for faster retrieval). &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="post-text" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The generic collections will perform better than their non-genericcounterparts, especially when iterating through many items. This isbecause boxing and unboxing no longer occurs. &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;HashSet&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt;The HashSet(T)class provides high performance set operations. A set is a collectionthat contains no duplicate elements, and whose elements are in noparticular order.&lt;br /&gt;The capacity of a HashSet(T) object is the number of elements that the object can hold. A HashSet(T) object's capacity automatically increases as elements are added to the object.&lt;/span&gt;&lt;br /&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;SortedList &lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Represents a collection of key/value pairs that are sortedby the keys and are accessible by key and by index.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}a:link, span.MsoHyperlink	{color:blue;	text-decoration:underline;	text-underline:single;}a:visited, span.MsoHyperlinkFollowed	{color:purple;	text-decoration:underline;	text-underline:single;}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}span.selflink	{mso-style-name:selflink;}span.cs	{mso-style-name:cs;}span.vb	{mso-style-name:vb;}span.cpp	{mso-style-name:cpp;}span.nu	{mso-style-name:nu;}span.input	{mso-style-name:input;}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;A &lt;b&gt;SortedList&lt;/b&gt;element can be accessed by its key, like an element in any &lt;b&gt;IDictionary &lt;/b&gt;implementation, or byits index, like an element in any &lt;b&gt;IList &lt;/b&gt;implementation.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;A &lt;b&gt;SortedList&lt;/b&gt;object internally maintains two arrays to store the elements of the list; thatis, one array for the keys and another array for the associated values. Eachelement is a key/value pair that can be accessed as a &lt;b&gt;DictionaryEntry &lt;/b&gt;object. A key cannotbe nullNothingnullptra null reference (Nothing in Visual Basic), but a value can be.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The capacity of a &lt;b&gt;SortedList&lt;/b&gt;object is the number of elements the &lt;b&gt;SortedList&lt;/b&gt; can hold. As elements are added to a &lt;b&gt;SortedList&lt;/b&gt;,the capacity is automatically increased as required through reallocation. Thecapacity can be decreased by calling &lt;b&gt;TrimToSize &lt;/b&gt;or by setting the &lt;b&gt;Capacity &lt;/b&gt;property explicitly.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The elements of a &lt;b&gt;SortedList&lt;/b&gt;object are sorted by the keys either according to a specific  implementation specifiedwhen the &lt;b&gt;IComparerSortedList&lt;/b&gt;is created or according to the &lt;b&gt;IComparable &lt;/b&gt;implementation providedby the keys themselves. In either case, a SortedListdoes not allow duplicate keys.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The index sequence is based on the sort sequence. When an element is added,it is inserted into &lt;b&gt;SortedList&lt;/b&gt;in the correct sort order, and the indexing adjusts accordingly. When anelement is removed, the indexing also adjusts accordingly. Therefore, the indexof a specific key/value pair might change as elements are added or removed fromthe &lt;b&gt;SortedList&lt;/b&gt;object.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Operations on a &lt;b&gt;SortedList&lt;/b&gt;object tend to be slower than operations on a &lt;b&gt;Hashtable &lt;/b&gt;object because of thesorting. However, the &lt;b&gt;SortedList&lt;/b&gt;offers more flexibility by allowing access to the values either through theassociated keys or through the indexes.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Elements in this collection can be accessed using an integer index. Indexesin this collection are zero-based.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The foreach statement of the C# language (for each in Visual Basic) requires the type of each elementin the collection. Since each element of the &lt;b&gt;SortedList&lt;/b&gt; object is a key/valuepair, the element type is not the type of the key or the type of the value.Rather, the element type is &lt;b&gt;DictionaryEntry&lt;/b&gt;.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;A &lt;b&gt;SortedList&lt;/b&gt;object can support multiple readers concurrently, as long as the collection isnot modified. To guarantee the thread safety of the SortedList,all operations must be done through the wrapper returned by the &lt;b&gt;Synchronized &lt;/b&gt;method.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Enumerating through a collection is intrinsically not a thread-safeprocedure. Even when a collection is synchronized, other threads can stillmodify the collection, which causes the enumerator to throw an exception. Toguarantee thread safety during enumeration, you can either lock the collectionduring the entire enumeration or catch the exceptions resulting from changesmade by other threads.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;LinkedList&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}a:link, span.MsoHyperlink	{color:blue;	text-decoration:underline;	text-underline:single;}a:visited, span.MsoHyperlinkFollowed	{color:purple;	text-decoration:underline;	text-underline:single;}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}span.selflink	{mso-style-name:selflink;}span.cs	{mso-style-name:cs;}span.vb	{mso-style-name:vb;}span.cpp	{mso-style-name:cpp;}span.nu	{mso-style-name:nu;}span.input	{mso-style-name:input;}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;LinkedList&lt;/b&gt;(T) is a general-purpose linked list.It supports enumerators and implements the &lt;b&gt;ICollection &lt;/b&gt;interface, consistentwith other collection classes in the .NET Framework.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;LinkedList&lt;/b&gt;(T) provides separate nodes of type &lt;b&gt;LinkedListNode&lt;/b&gt;(T), so insertion and removal are O(1) operations.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;You can remove nodes and reinsert them, either in the same list or inanother list, which results in no additional objects allocated on the &lt;b&gt;heap&lt;/b&gt;.Because the list also maintains an internal count, getting the &lt;b&gt;Count &lt;/b&gt;property is an O(1) operation.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Each node in a &lt;b&gt;LinkedList&lt;/b&gt;(T) object is of thetype &lt;b&gt;LinkedListNode&lt;/b&gt;(T). Because the &lt;b&gt;LinkedList&lt;/b&gt;(T) isdoubly linked, each node points forward to the Next node and backward to the Previous node. &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Lists that contain reference types perform better when a node and its valueare created at the same time. &lt;b&gt;LinkedList&lt;/b&gt;(T) accepts &lt;b&gt;null &lt;/b&gt;reference (Nothing in Visual Basic) as a valid Value property for reference typesand allows duplicate values. &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;If the &lt;b&gt;LinkedList&lt;/b&gt;(T) is empty, the &lt;b&gt;First &lt;/b&gt;and &lt;b&gt;Last &lt;/b&gt;properties contain &lt;b&gt;null &lt;/b&gt;reference (Nothing in Visual Basic).&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;LinkedList&lt;/b&gt;(T)&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt; class does not supportchaining, splitting, cycles, or other features that can leave the list in aninconsistent state. The list remains consistent on a single thread. The only&lt;b&gt;multithreaded &lt;/b&gt;scenario supported by &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;LinkedList&lt;/b&gt;(T)&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;is multithreaded read operations&lt;/span&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;Linked lists are preferable over arrays when:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;a) you need constant-time insertions/deletions from the list (such as inreal-time computing where time predictability is absolutely critical)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;b) you don't know how many items will be in the list. With arrays, you mayneed to re-declare and copy memory if the array grows too big&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;c) you don't need random access to any elements&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;d) you want to be able to insert items in the middle of the list (such as apriority queue)&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;Arrays are preferable when:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;a) you need indexed/random access to elements&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;b) you know the number of elements in the array ahead of time so that youcan allocate the correct amount of memory for the array&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;c) you need speed when iterating through all the elements in sequence. Youcan use pointer math on the array to access each element, whereas you need tolookup the node based on the pointer for each element in linked list, which mayresult in page faults which may result in performance hits.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;d) memory is a concern. Filled arrays take up less memory than linked lists.Each element in the array is just the data. Each linked list node requires thedata as well as one (or more) pointers to the other elements in the linkedlist.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Array Lists (like those in .Net) give you the benefits of arrays, butdynamically allocate resources for you so that you don't need to worry too muchabout list size and you can delete items at any index without any effort orre-shuffling elements around. Performance-wise, arraylists are slower than rawarrays&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br&gt;&lt;b&gt;Dictionary&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}span.selflink	{mso-style-name:selflink;}span.vb	{mso-style-name:vb;}span.nu	{mso-style-name:nu;}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The Dictionary (TKey, TValue) generic classprovides a mapping from a set of keys to a set of values. Each addition to thedictionary consists of a value and its associated key. Retrieving a value byusing its key is very fast, close to O(1), because the Dictionary(TKey, TValue)class is implemented as a hash table.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}span.selflink	{mso-style-name:selflink;}span.vb	{mso-style-name:vb;}span.nu	{mso-style-name:nu;}span.input	{mso-style-name:input;}span.parameter	{mso-style-name:parameter;}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;As long as an object is used as a key in the Dictionary (TKey,TValue), it must not change in any way thataffects its hash value. Every key in a Dictionary(TKey, TValue)must be unique according to the dictionary's equality comparer. A key cannot benull reference (Nothing in Visual Basic), but a value can be, if the value type TValue is a reference type.&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}span.selflink	{mso-style-name:selflink;}span.cs	{mso-style-name:cs;}span.vb	{mso-style-name:vb;}span.nu	{mso-style-name:nu;}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The capacity of a Dictionary (TKey, TValue) is the number ofelements the Dictionary (TKey, TValue) can hold. As elementsare added to a Dictionary (TKey, TValue), the capacity isautomatically increased as required by reallocating the internal array.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;For purposes of enumeration, each item in the dictionary is treated as a KeyValuePair&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;u&gt;&lt;span style="color: blue;"&gt;(&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;TKey, TValue&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;u&gt;&lt;span style="color: blue;"&gt;)&lt;/span&gt;&lt;/u&gt;&lt;/span&gt; &lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;structure representinga value and its key. The order in which the items are returned is undefined.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso" rel="Edit-Time-Data"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}span.header3	{mso-style-name:header3;}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;How Arrays and Lists Access Information&lt;/b&gt;&lt;br /&gt;Most arrays and lists retrieve information by scanning many values. If you hadto search a list for the existence of a particular file, you would end upscanning many elements until you reached the element you are interested in. Youmay end up scanning every element, or if your search algorithm is moreefficient, you may search a smaller subset of all elements.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The following image shows a n-item array/list with a value somewhere in themiddle:&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_miK8PFFNIaE/SxtydBDATYI/AAAAAAAAB34/xm9JjmjCBU8/s1600-h/array_hashimage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_miK8PFFNIaE/SxtydBDATYI/AAAAAAAAB34/xm9JjmjCBU8/s320/array_hashimage.png" /&gt;&lt;span id="goog_1260089347799"&gt;&lt;/span&gt;&lt;span id="goog_1260089347800"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: center;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;In order to find the cell containing your value, in the worst case, you haveto scan all of the cells starting at position 1 and ending once you reach theposition of your value. You may use a divide and conquer approach and find theresult logarithmically, but even that is not the fastest approach. You arewasting computation cycles in scanning cells that do not contain the value.That is not the most efficient way of finding information when you have largeamounts of data.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;How Dictionaries/Hashtables Work&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Dictionaries &lt;/b&gt;and &lt;b&gt;Hashtables &lt;/b&gt;work by finding the exact location your value isstored and returning that value in constant time. In other words, no matter howlarge your collection of data, you will find an answer in a few steps. In ourlinear example, it would take many steps.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Here is a simplified view of how a &lt;b&gt;dictionary/hashtable&lt;/b&gt; representsinformation:&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_miK8PFFNIaE/Sxtyjty77_I/AAAAAAAAB4A/ngZfj4Ql6UI/s1600-h/hash_hashimage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_miK8PFFNIaE/Sxtyjty77_I/AAAAAAAAB4A/ngZfj4Ql6UI/s320/hash_hashimage.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: center;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;As you have seen from declaring a Dictionary, when you add a &lt;b&gt;value&lt;/b&gt; toa dictionary, you specify a &lt;b&gt;key&lt;/b&gt; also. The key goes through some kind oftransformation called &lt;b&gt;&lt;i&gt;hashing&lt;/i&gt;&lt;/b&gt;, and the output of this hashing operationis an index number of a location in an array-like structure commonly referredto as a bucket. Your value is added directly to the bucket referenced by yourindex number returned by the hash function.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&amp;nbsp;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-9025638279080114632?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/9025638279080114632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=9025638279080114632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/9025638279080114632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/9025638279080114632'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/net-data-structures.html' title='Net Data Structures'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_miK8PFFNIaE/SxtydBDATYI/AAAAAAAAB34/xm9JjmjCBU8/s72-c/array_hashimage.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-1120164586396793959</id><published>2009-12-05T20:06:00.000-08:00</published><updated>2009-12-05T20:06:04.490-08:00</updated><title type='text'>Derived Tables in SQL</title><content type='html'>&lt;pre&gt; SELECT LastName, FirstName&lt;br /&gt; FROM&lt;br /&gt;  (SELECT * FROM Employee&lt;br /&gt;   WHERE State = "NY") AS EmployeeDerivedTable&lt;br /&gt; WHERE LastName = "Smith"&lt;br /&gt; ORDER BY FirstName&lt;/pre&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;What we are doing is first getting the result set fromour derived table (the SELECT statement in the FROM clause).  Once we havethat resultset, it is as though it was a table in itself.  We then performthe SELECT on the derived table, returning our results.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-1120164586396793959?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/1120164586396793959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=1120164586396793959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/1120164586396793959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/1120164586396793959'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/derived-tables-in-sql.html' title='Derived Tables in SQL'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-2254306754645289965</id><published>2009-12-05T19:56:00.000-08:00</published><updated>2009-12-05T19:58:57.966-08:00</updated><title type='text'>Using TABLE Variables in SQL Server</title><content type='html'>&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;If you're using temporary tables and don't need transactions on thosetables and want better performance I'd strongly consider using tablevariables instead. Table variables were introduced in SQL Server 2000. &lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The only constraints you can use are PRIMARY KEY, UNIQUE KEY, and NULL.  The following script will work just fine in Northwind:&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre class="code"&gt;declare @TableVar table ( &lt;br /&gt; NewPK int identity(1,1), &lt;br /&gt; CustomerID nchar(5) NOT NULL  )&lt;br /&gt;&lt;br /&gt;Insert Into @TableVar (CustomerID)&lt;br /&gt;Select CustomerID&lt;br /&gt;From Customers&lt;br /&gt;&lt;br /&gt;Select Top 5 *&lt;br /&gt;from @TableVar&lt;/pre&gt;&lt;pre class="code"&gt;&amp;nbsp;&lt;/pre&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;When you create a temporary table (#TABLE) it physically creates the table in tempdb.This creates overhead. When you create a table variable it only resides in memory which means it's much faster. A table variable goes out ofscope immediate after the batch ends -- just like regular variables.This means you don't have to explicitly drop them at the end ofscripts.Using table variables also reduces the recompilations of your code. Also because they aren't physically written to the disk theyaren't impacted by transaction rollbacks. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-2254306754645289965?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/2254306754645289965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=2254306754645289965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2254306754645289965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2254306754645289965'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/using-table-variables-in-sql-server.html' title='Using TABLE Variables in SQL Server'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-538541299975475088</id><published>2009-12-05T19:12:00.000-08:00</published><updated>2009-12-05T19:44:07.493-08:00</updated><title type='text'>Send a email message using SMTP</title><content type='html'>&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;public&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EmailMessage&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; FromEmailAddress { &lt;span style="color: blue;"&gt;get&lt;/span&gt;;&lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;&amp;gt;ToEmailAddresses { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;&amp;gt;CCEmailAddresses { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;&amp;gt;BCCEmailAddresses { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Subject { &lt;span style="color: blue;"&gt;get&lt;/span&gt;;&lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; MessageBody { &lt;span style="color: blue;"&gt;get&lt;/span&gt;;&lt;span style="color: blue;"&gt;set&lt;/span&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&amp;nbsp;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;public&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EmailManager&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Send a email message using SMTP server configured in theconfig file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&amp;lt;paramname="message"&amp;gt;&amp;lt;/param&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: grey;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: grey;"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; SendMail(&lt;span style="color: #2b91af;"&gt;EmailMessage&lt;/span&gt; message)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;.IsNullOrEmpty(message.FromEmailAddress)|| (message.ToEmailAddresses.Count == 0) ||&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;.IsNullOrEmpty(message.Subject)|| &lt;span style="color: blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(message.MessageBody))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;throw&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"The message is incomplete. One or more of theparameters missing: From, To, Subject or Body."&lt;/span&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;MailMessage&lt;/span&gt;newMsg = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MailMessage&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMsg.From = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MailAddress&lt;/span&gt;(message.FromEmailAddress);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt; toEmailId &lt;span style="color: blue;"&gt;in&lt;/span&gt;message.ToEmailAddresses)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMsg.To.Add(toEmailId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt;(message.CCEmailAddresses != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt; ccEmailId &lt;span style="color: blue;"&gt;in&lt;/span&gt;message.CCEmailAddresses)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newMsg.CC.Add(ccEmailId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;(message.BCCEmailAddresses != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt; bccEmailId &lt;span style="color: blue;"&gt;in&lt;/span&gt;message.BCCEmailAddresses)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newMsg.Bcc.Add(bccEmailId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMsg.Subject =message.Subject;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newMsg.Body = message.MessageBody;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SmtpClient&lt;/span&gt;mailClient = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SmtpClient&lt;/span&gt;();&lt;span style="color: green;"&gt;//Will use config file settings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailClient.Send(newMsg);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;catch&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;throw&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;br /&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;public&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; SendMail(&lt;span style="color: blue;"&gt;string&lt;/span&gt;fromEmailAddress, &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt; toEmailAddresses, &lt;span style="color: blue;"&gt;string&lt;/span&gt;subject, &lt;span style="color: blue;"&gt;string&lt;/span&gt; messageBody)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;try&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;bool&lt;/span&gt;status = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;EmailMessage&lt;/span&gt;message = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EmailMessage&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message.FromEmailAddress = &lt;span style="color: #a31515;"&gt;"Mail@masoomsabri.com"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message.ToEmailAddresses =toEmailAddresses;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message.Subject = subject;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message.MessageBody =messageBody;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = &lt;span style="color: #2b91af;"&gt;EmailManager&lt;/span&gt;.SendMail(message);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt;status;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;Configure Web.Config file&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.25in 1.0in 1.25in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;}--&gt;&lt;/style&gt;&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;mailSettings&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;gt;&lt;o:p&gt; &lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp; &amp;lt;!--&lt;/span&gt;&lt;span style="color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt; Update fortesting with a SMTP server&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;smtp&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;network&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&lt;/span&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;host&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;=&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;"&lt;span style="color: blue;"&gt;172.27.66.88&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;port&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;25&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;userName&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;username&lt;/span&gt;"&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;password&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;password&lt;/span&gt;"&lt;span style="color: blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;smtp&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;mailSettings&lt;/span&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-538541299975475088?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/538541299975475088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=538541299975475088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/538541299975475088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/538541299975475088'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/12/send-email-message-using-smtp.html' title='Send a email message using SMTP'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-4041508460120376298</id><published>2009-11-29T12:34:00.000-08:00</published><updated>2009-11-29T12:36:59.070-08:00</updated><title type='text'>Thread Interview Question</title><content type='html'>&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;1.What is Multi-tasking ?&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The ability to execute more than one task at the same time, a task being a program. The terms multitasking and multiprocessing are often used interchangeably, although multiprocessing implies that more than one CPU is involved.&lt;br /&gt;In multitasking, only one CPU is involved, but it switches from one program to another so quickly that it gives the appearance of executing all of the programs at the same time.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;2.&lt;/span&gt;&lt;span style="font-size: small;"&gt;What is threading?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Each &lt;/span&gt;&lt;span style="color: blue; font-family: Arial; font-weight: 400; position: static;"&gt;&lt;span style="color: blue; font-weight: 400; position: static;"&gt;&lt;/span&gt;&lt;/span&gt;application/programthat is running in the system is a process. Each process consist of oneor more thread. These process can whole or part of the application/program. A thread is a set of instruction or specific section ofapplication that executes independently within the application orsystem. This can be also thought as the context in which code runs. Sothreads are basically light weight processes responsible formultitasking within a single application. Usually OS takes care ofscheduling and execution of various threads. &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;b&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;2.&lt;/span&gt;&lt;span style="font-size: small;"&gt;What is Multi threading?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;When the system is buildon various threads to perform multiple tasks to achieve parallelism andimprove the efficiency of the system. This is the ability of any systemto do multiple tasks simultaneously. Threads are implement when thereare situations in which more then one task at a time need to becompleted.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;Some of the benefits of threading are mentioned as follows:&lt;/i&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Using threads the long duration tasks in application can be processed at the background&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: blue; font-family: Arial; font-weight: 400; position: static;"&gt;&lt;span style="color: blue; font-weight: 400; position: static;"&gt;User &lt;/span&gt;&lt;span style="color: blue; font-weight: 400; position: static;"&gt;interface&lt;/span&gt;&lt;/span&gt;can be made more appealing so that there is some task performed duringvarious events like when the user clicks button for the processing someaction a progress bar can be shown to show the progress of activity.&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Speed of the application can be increased.&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Threads can be useful in situations where there are &lt;span style="color: blue; font-family: Arial; font-weight: 400; position: static;"&gt;&lt;span style="color: blue; font-weight: 400; position: static;"&gt;gaps&lt;/span&gt;&lt;/span&gt;between tasks waiting for some event such as user input, file read, orreceipt of data over the network. During the situation we can releasevarious precious resources like memory usages etc&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size: small;"&gt;&lt;b style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;3.How does multi-threading work in .NET?&lt;/b&gt;&lt;br style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;" /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;      .NET has been designed from the start to support multi-threaded operation. There      are two main ways of multi-threading which .NET encourages: starting your own threads      with &lt;/span&gt;&lt;code style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;ThreadStart&lt;/code&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt; delegates, and using the &lt;/span&gt;&lt;code style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;ThreadPool&lt;/code&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt; class       either directly (using &lt;/span&gt;&lt;code style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;ThreadPool.QueueUserWorkItem&lt;/code&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;) or indirectly using      asynchronous methods (such as &lt;/span&gt;&lt;code style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Stream.BeginRead&lt;/code&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;, or calling &lt;/span&gt;&lt;code style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;BeginInvoke&lt;/code&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;      on any delegate).    &lt;/span&gt;&lt;br style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;" /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;      In general, you should create a new thread "manually" for long-running tasks, and use the      thread pool only for brief jobs. The thread pool can only run so many jobs at once, and      some framework classes use it internally, so you don't want to block it with a lot of      tasks which need to block for other things. The examples in this article mostly use      manual thread creation. On the other hand, for short-running tasks, particularly those created      often, the thread pool is an excellent choic&lt;/span&gt;    &lt;/span&gt;     &lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.Threading;&lt;br /&gt;&lt;br /&gt;public class Test&lt;br /&gt;{&lt;br /&gt;    static void Main()&lt;br /&gt;    {&lt;br /&gt;        ThreadStart job = new ThreadStart(ThreadJob);&lt;br /&gt;        Thread thread = new Thread(job);&lt;br /&gt;        thread.Start();&lt;br /&gt;        &lt;br /&gt;        for (int i=0; i &amp;lt; 5; i++)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine ("Main thread: {0}", i);&lt;br /&gt;            Thread.Sleep(1000);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    static void ThreadJob()&lt;br /&gt;    {&lt;br /&gt;        for (int i=0; i &amp;lt; 10; i++)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine ("Other thread: {0}", i);&lt;br /&gt;            Thread.Sleep(500);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-4041508460120376298?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/4041508460120376298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=4041508460120376298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/4041508460120376298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/4041508460120376298'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/11/thread-interview-question.html' title='Thread Interview Question'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-7563546569209919710</id><published>2009-11-29T09:04:00.000-08:00</published><updated>2009-11-29T11:51:40.113-08:00</updated><title type='text'>Thread Pool</title><content type='html'>&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt;Thread pool is basically collection of threads which can be &lt;span795441&gt;used&lt;/span795441&gt; for preforming task in background. Using thread pool is a good practice over creating a new thread for you  task. Whenever the task of a thread from thread pool is completed, then the thread is  &lt;span795441&gt;automatically&lt;/span795441&gt; returned back into the thread queue so that it can be re-used by other  asynchronous requests. .NET provides inbuilt support for thread pool. Below is a &lt;span795441&gt;simple&lt;/span795441&gt; example  which will explain how can we use the thread pool.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span id="ctl00_MTCS_main_ctl03"&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="libCScode" id="ctl00_MTCS_main_ctl03_code" space="preserve" style="white-space: pre-wrap;"&gt;&lt;span id="ctl00_MTCS_main_ctl03"&gt;using System;&lt;br /&gt;using System.Threading;&lt;br /&gt;&lt;br /&gt;namespace ThreadPoolTest&lt;br /&gt;{&lt;br /&gt;   class MainApp&lt;br /&gt;   {&lt;br /&gt;      static void Main()&lt;br /&gt;      {&lt;br /&gt;         WaitCallback callBack;&lt;br /&gt;&lt;br /&gt;         callBack = new WaitCallback(PooledFunc);&lt;br /&gt;         ThreadPool.QueueUserWorkItem(callBack,&lt;br /&gt;            "Is there any screw left?");&lt;br /&gt;         ThreadPool.QueueUserWorkItem(callBack,&lt;br /&gt;            "How much is a 40W bulb?");&lt;br /&gt;         ThreadPool.QueueUserWorkItem(callBack,&lt;br /&gt;            "Decrease stock of monkey wrench");   &lt;br /&gt;         Console.ReadLine();&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      static void PooledFunc(object state)&lt;br /&gt;      {&lt;br /&gt;         Console.WriteLine("Processing request '{0}'", (string)state);&lt;br /&gt;         // Simulation of processing time&lt;br /&gt;         Thread.Sleep(2000);&lt;br /&gt;         Console.WriteLine("Request processed");&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="libCScode" id="ctl00_MTCS_main_ctl03_code" space="preserve" style="white-space: pre-wrap;"&gt;&lt;span id="ctl00_MTCS_main_ctl03"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;div class="title" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;ThreadPool.QueueUserWorkItem Method &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;div class="summary"&gt;&lt;span style="font-size: small;"&gt;Queues a method for execution. The method executes when a thread pool thread becomes available.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span id="ctl00_MTCS_main_ctl03" style="font-size: small;"&gt;QueueUserWorkItem(WaitCallback):Queues a method for execution. The method executes when a thread pool thread becomes available.&amp;nbsp;&lt;/span&gt;&lt;span id="ctl00_MTCS_main_ctl03" style="font-size: small;"&gt;QueueUserWorkItem(WaitCallback, Object) :Queues a method for execution, and specifies an object containing data to be used by the method. The method executes when a thread pool thread becomes available. &lt;/span&gt;&lt;b&gt;&lt;span id="ctl00_MTCS_main_ctl03" style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span id="ctl00_MTCS_main_ctl03" style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style="font-size: small;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;WorkerThreads&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;The worker threads are part of the standard System pool. They are standard threads managed by the .NET Framework and most of the functions are executed on them, specifically user requests (&lt;b&gt;QueueUserWorkItem&lt;/b&gt; method), functions based on synchronization objects (&lt;b&gt;RegisterWaitForSingleObject&lt;/b&gt; method), and timers (Timer classes).&lt;/span&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span id="ctl00_MTCS_main_ctl03"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre class="libCScode" id="ctl00_MTCS_main_ctl03_code" space="preserve" style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; white-space: pre-wrap;"&gt;&lt;b&gt;&lt;span id="ctl00_MTCS_main_ctl03" style="font-size: small;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span id="ctl00_MTCS_main_ctl03"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-7563546569209919710?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/7563546569209919710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=7563546569209919710' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/7563546569209919710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/7563546569209919710'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/11/thread-pool.html' title='Thread Pool'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-6300491543647728011</id><published>2009-11-28T18:13:00.000-08:00</published><updated>2009-11-28T18:14:58.868-08:00</updated><title type='text'>LINQ Introduction</title><content type='html'>&lt;span style="font-size: small;"&gt;&lt;b style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;What is the LINQ.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;LINQ is uniform programming model for any kind of data.LINQ enables you to query and manipulate data with a consistent model that is independent from data sources.&lt;/span&gt;&lt;/li&gt;&lt;li style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;LINQ is Just another tool for embedding SQL queries into code.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;LINQ is yet another data abstraction layer.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;LINQ is a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with native language syntax for queries and provides class libraries to take advantage of these capabilities.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Each customer has own set of orders and each order has its own list of products.Using LINQ, We can get the list of products ordered by each customer in this way. &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;var query=from c in Customers&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from o in c.Orders&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select new { c.Name, o.Quantity, o.Product.ProductName };&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;LINQ implementations provided by Microsoft within NET 3.5.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;LINQ to Objects&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;LINQ to ADO.NET(LINQ to SQL, LINQ to DataSet, LINQ to Entities)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;LINQ to XML &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-6300491543647728011?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/6300491543647728011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=6300491543647728011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/6300491543647728011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/6300491543647728011'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/11/linq-introduction.html' title='LINQ Introduction'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-5611133992079300061</id><published>2009-11-27T11:44:00.000-08:00</published><updated>2009-11-27T11:46:40.882-08:00</updated><title type='text'>WPF Interview Question II</title><content type='html'>&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;What Are Commands? &lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;What makes commands different form a simple event handler attached to a button or a timer is that commands separate the semantics of an action from its logic. This allows for multiple and disparate sources to invoke the same command logic, and allows the command logic to be customized for different targets.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;Four Main Concepts in WPF Commanding&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;The routed command model in WPF can be broken up into four main concepts: the command, the command source, the command target, and the command binding. The command is the action to be executed. The command source is the object which invokes the command. The command target is the object that the command is being executed on. And finally, the command binding is the object which maps the command logic to the command.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span id="ctl00_MTCS_main_ctl10"&gt;&lt;pre class="libCScode" id="ctl00_MTCS_main_ctl10_code" space="preserve" style="white-space: pre-wrap;"&gt;"&amp;lt;StackPanel&amp;gt;&lt;br /&gt;  &amp;lt;Menu&amp;gt;&lt;br /&gt;    &amp;lt;MenuItem Command=&lt;span style="color: maroon;"&gt;"ApplicationCommands.Paste"&lt;/span&gt; /&amp;gt;&lt;br /&gt;  &amp;lt;/Menu&amp;gt;&lt;br /&gt;  &amp;lt;TextBox /&amp;gt;&lt;br /&gt;&amp;lt;/StackPanel&amp;gt;"&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;In the example, &lt;/span&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;the Paste command is the command, the MenuItem is the command source, the TextBox is the command target, and the command binding is supplied by the TextBox control. It is worth noting that it is not always the case that the CommandBinding is supplied by the control. Quite often the CommandBinding must be created by the application developer and the CommandBinding may be attached to an ancestor of the command target.&lt;/span&gt; &lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;b&gt;Commands&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Commands in WPF are created by implementing the ICommand interface. ICommand exposes two methods and an event: Execute, CanExecute, and CanExecuteChanged. Execute performs the action of the command, CanExecute determines whether the command can execute on the current command target, and CanExecuteChanged signifies that the ability of the command to execute may have changed.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-5611133992079300061?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/5611133992079300061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=5611133992079300061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/5611133992079300061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/5611133992079300061'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/11/wpf-interview-question-ii.html' title='WPF Interview Question II'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-2722801464998220880</id><published>2009-11-25T17:14:00.001-08:00</published><updated>2009-11-25T17:14:14.796-08:00</updated><title type='text'>Scrum Methodologies</title><content type='html'>&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face	{font-family:Wingdings;	panose-1:5 0 0 0 0 0 0 0 0 0;	mso-font-charset:2;	mso-generic-font-family:auto;	mso-font-pitch:variable;	mso-font-signature:0 268435456 0 0 -2147483648 0;}@font-face	{font-family:Calibri;	panose-1:2 15 5 2 2 2 4 3 2 4;	mso-font-charset:0;	mso-generic-font-family:swiss;	mso-font-pitch:variable;	mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin-top:0in;	margin-right:0in;	margin-bottom:10.0pt;	margin-left:0in;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:Calibri;	mso-fareast-font-family:"Times New Roman";	mso-bidi-font-family:"Times New Roman";}@page Section1	{size:8.5in 11.0in;	margin:1.0in 1.0in 1.0in 1.0in;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;} /* List Definitions */ @list l0	{mso-list-id:2013751858;	mso-list-template-ids:-1684642134;}@list l0:level1	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:.5in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}ol	{margin-bottom:0in;}ul	{margin-bottom:0in;}--&gt;&lt;/style&gt;  &lt;br /&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-size: 18pt; line-height: 115%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;The Scrum methodology of agile software development marks a dramatic departure from waterfall management. In fact, Scrum and other agile processes were inspired by its shortcomings. The Scrum methodology emphasizes communication and collaboration, functioning software, and the flexibility to adapt to emerging business realities — all attributes that suffer in the rigidly ordered waterfall paradigm.&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt;"&gt;For many developers in the software industry, the &lt;/span&gt;&lt;a href="http://agilemethodology.org/" target="_blank"&gt;&lt;span style="font-size: 12pt;"&gt;agile methodology&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt; is nothing new. Most folks know that agile was a direct response to the dominant project management paradigm, waterfall, and borrows many principles from lean manufacturing. In 2001, as this new management paradigm began to pick up momentum, agile was formalized when 17 pioneers of the agile methodology met at the Snowbird Ski Resort in Utah and issued the Agile Manifesto. Their manifesto is now considered the foundational text for agile practices and principles. Most importantly, the manifesto spelled out the philosophy behind agile, which places a new emphasis on communication and collaboration; functioning software; and the flexibility to adapt to emerging business realities.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt;"&gt;But for all of the strides the Agile Manifesto made in revising a philosophical approach to software development, it didn’t provide the concrete processes that development teams depend on when deadlines — and stakeholders — start applying pressure. As a result, when it comes to the nuts and bolts of running a team with agile every day, organizations turn to particular subsets of the &lt;/span&gt;&lt;a href="http://agilemethodology.org/" target="_blank"&gt;&lt;span style="font-size: 12pt;"&gt;agile methodology&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt;. These include Crystal Clear, Extreme Programming, Feature Driven Development, Dynamic Systems Development Method (DSDM), Scrum, and others. At my organization, we use Scrum and I’ve found it to be an incredibly effective management methodology for everyone involved, including developers and stakeholders. If you’re interested in learning about the other &lt;/span&gt;&lt;a href="http://agilemethodology.org/" target="_blank"&gt;&lt;span style="font-size: 12pt;"&gt;agile methodologies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt;, there are plenty of resources out there. This blog is designed to provide some essential background for those who are new to Scrum.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 13.5pt;"&gt;What’s Unique about Scrum?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt;"&gt;Of all the &lt;/span&gt;&lt;a href="http://agilemethodology.org/" target="_blank"&gt;&lt;span style="font-size: 12pt;"&gt;agile methodologies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt;, Scrum is unique because it introduced the idea of “empirical process control.” That is, Scrum uses the real-world progress of a project — not a best guess or uninformed forecast — to plan and schedule releases. In Scrum, projects are divided into succinct work cadences, known as sprints, which are typically one week, two weeks, or three weeks in duration. At the end of each sprint, stakeholders and team members meet to assess the progress of a project and plan its next steps. This allows a project’s direction to be adjusted or reoriented based on completed work, not speculation or predictions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt;"&gt;Philosophically, this emphasis on an ongoing assessment of completed work is largely responsible for its popularity with managers and developers alike. But what allows the Scrum methodology to really work is a set of roles, responsibilities, and meetings that never change. If Scrum’s capacity for adaption and flexibility makes it an appealing option, the stability of its practices give teams something to lean on when development gets chaotic.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 13.5pt;"&gt;The Roles of Scrum&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal;"&gt;&lt;span style="font-size: 12pt;"&gt;Scrum has three fundamental roles: &lt;/span&gt;&lt;a href="http://scrummethodology.com/scrum-product-owner/"&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt;, ScrumMaster, and team member.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt;"&gt; In Scrum, the &lt;/span&gt;&lt;a href="http://scrummethodology.com/scrum-product-owner/"&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt; is responsible for communicating the vision of the product to the      development team. He or she must also represent the customer’s interests      through requirements and prioritization. Because the &lt;/span&gt;&lt;a href="http://scrummethodology.com/scrum-product-owner/"&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt; has the most authority of the three roles, it’s also the role      with the most responsibility. In other words, the &lt;/span&gt;&lt;a href="http://scrummethodology.com/scrum-product-owner/"&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt; is the single individual who must face the music when a project      goes awry. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-left: 0.5in;"&gt;&lt;span style="font-size: 12pt;"&gt;The tension between authority and responsibility means that it’s hard for Product Owners to strike the right balance of involvement. Because Scrum values self-organization among teams, a &lt;/span&gt;&lt;a href="http://scrummethodology.com/scrum-product-owner/"&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt; must fight the urge to micro-manage. At the same time, Product Owners must be available to answer questions from the team.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;ScrumMaster:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt;"&gt; The ScrumMaster acts as a liaison between the Product Owner and      the team. The ScrumMaster does not manage the team. Instead, he or she      works to remove any impediments that are obstructing the team from      achieving its sprint goals. In short, this role helps the team remain      creative and productive, while making sure its successes are visible to      the &lt;/span&gt;&lt;a href="http://scrummethodology.com/scrum-product-owner/"&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt;. The ScrumMaster also works to advise the &lt;/span&gt;&lt;a href="http://scrummethodology.com/scrum-product-owner/"&gt;&lt;span style="font-size: 12pt;"&gt;Product Owner&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt;"&gt; about how to maximize ROI for the team. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;Team Member:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt;"&gt; In the Scrum methodology, the team is responsible for completing      work. Ideally, teams consist of seven cross-functional members, plus or      minus two individuals. For software projects, a typical team includes a      mix of software engineers, architects, programmers, analysts, QA experts,      testers, and UI designers. Each sprint, the team is responsible for      determining how it will accomplish the work to be completed. This grants      teams a great deal of autonomy, but, similar to the Product Owner’s      situation, that freedom is accompanied by a responsibility to meet the      goals of the sprint. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3455606985251406530-2722801464998220880?l=masoomsabri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://masoomsabri.blogspot.com/feeds/2722801464998220880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3455606985251406530&amp;postID=2722801464998220880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2722801464998220880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3455606985251406530/posts/default/2722801464998220880'/><link rel='alternate' type='text/html' href='http://masoomsabri.blogspot.com/2009/11/scrum-methodologies.html' title='Scrum Methodologies'/><author><name>Masoom</name><uri>http://www.blogger.com/profile/12173050185555715677</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3455606985251406530.post-935292661641588224</id><published>2009-11-25T16:39:00.000-08:00</published><updated>2009-11-26T18:14:52.940-08:00</updated><title type='text'>SQL Interview question</title><content type='html'>&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt;&lt;/meta&gt;&lt;meta content="Word.Document" name="ProgId"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Generator"&gt;&lt;/meta&gt;&lt;meta content="Microsoft Word 11" name="Originator"&gt;&lt;/meta&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" rel="File-List"&gt;&lt;/link&gt;&lt;link href="file:///D:%5CDOCUME%7E1%5CTRAINE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso" rel="Edit-Time-Data"&gt;&lt;/link&gt;&lt;o:smarttagtype name="PlaceType" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype name="PlaceName" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype name="State" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype name="City" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype name="place" namespaceuri="urn:schemas-microsoft-com:office:smarttags"&gt;&lt;/o:smarttagtype&gt;&lt;style&gt;&lt;!-- /* Font Definitions */ @font-face	{font-family:Wingdings;	panose-1:5 0 0 0 0 0 0 0 0 0;	mso-font-charset:2;	mso-generic-font-family:auto;	mso-font-pitch:variable;	mso-font-signature:0 268435456 0 0 -2147483648 0;}@font-face	{font-family:Calibri;	panose-1:2 15 5 2 2 2 4 3 2 4;	mso-font-charset:0;	mso-generic-font-family:swiss;	mso-font-pitch:variable;	mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal	{mso-style-parent:"";	margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}h5	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	mso-outline-level:5;	font-size:10.0pt;	font-family:"Times New Roman";	font-weight:bold;}h6	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	mso-outline-level:6;	font-size:7.5pt;	font-family:"Times New Roman";	font-weight:bold;}a:link, span.MsoHyperlink	{color:blue;	text-decoration:underline;	text-underline:single;}a:visited, span.MsoHyperlinkFollowed	{color:purple;	text-decoration:underline;	text-underline:single;}p	{mso-margin-top-alt:auto;	margin-right:0in;	mso-margin-bottom-alt:auto;	margin-left:0in;	mso-pagination:widow-orphan;	font-size:12.0pt;	font-family:"Times New Roman";	mso-fareast-font-family:"Times New Roman";}code	{font-family:"Courier New";	mso-ascii-font-family:"Courier New";	mso-fareast-font-family:"Courier New";	mso-hansi-font-family:"Courier New";	mso-bidi-font-family:"Courier New";}pre	{margin:0in;	margin-bottom:.0001pt;	mso-pagination:widow-orphan;	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;	font-size:10.0pt;	font-family:"Courier New";	mso-fareast-font-family:"Courier New";	mso-bidi-font-family:"Times New Roman";}@page Section1	{size:595.45pt 841.7pt;	margin:1.0in 37.45pt 1.0in 45.0pt;	mso-header-margin:.5in;	mso-footer-margin:.5in;	mso-paper-source:0;}div.Section1	{page:Section1;} /* List Definitions */ @list l0	{mso-list-id:62607568;	mso-list-type:hybrid;	mso-list-template-ids:-248867032 -2063163236 -388716398 -1676541896 -1315545502 1853236508 171767734 -1065328294 444893186 875982818;}@list l0:level1	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:.5in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l1	{mso-list-id:853300799;	mso-list-type:hybrid;	mso-list-template-ids:-89989696 -875762272 -1532090184 2054208022 1763186968 -60621160 -1828175664 -945285478 2010019974 1202902970;}@list l1:level1	{mso-level-tab-stop:.5in;	mso-level-number-position:left;	text-indent:-.25in;}@list l1:level2	{mso-level-number-format:bullet;	mso-level-text:o;	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:"Courier New";	mso-bidi-font-family:"Times New Roman";}@list l1:level3	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:1.5in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l2	{mso-list-id:1284968238;	mso-list-type:hybrid;	mso-list-template-ids:343839564 1694424862 807053456 985145730 -228674496 -1587674602 1025530024 -2124750828 -437350168 -1875754216;}@list l2:level1	{mso-level-tab-stop:.5in;	mso-level-number-position:left;	text-indent:-.25in;}@list l2:level2	{mso-level-number-format:bullet;	mso-level-text:o;	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:"Courier New";	mso-bidi-font-family:"Times New Roman";}@list l2:level3	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:1.5in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l3	{mso-list-id:1443105897;	mso-list-type:hybrid;	mso-list-template-ids:-1298888588 1386224186 1685718712 551052080 2134687610 896177916 -1088751558 1977658724 1407888264 789715060;}@list l3:level1	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:.5in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l4	{mso-list-id:1712221250;	mso-list-type:hybrid;	mso-list-template-ids:-1172402714 889854118 -106404452 2098906840 -202996272 -255809932 687791392 -1268990406 1151350742 -2123986312;}@list l4:level1	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:.5in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l5	{mso-list-id:1771928617;	mso-list-type:hybrid;	mso-list-template-ids:163058686 2016577156 -352702588 1159745734 1320709974 -1066778486 2009872466 835744670 -655056104 1496997598;}@list l5:level1	{mso-level-tab-stop:.5in;	mso-level-number-position:left;	text-indent:-.25in;}@list l5:level2	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l5:level3	{mso-level-number-format:bullet;	mso-level-text:;	mso-level-tab-stop:1.5in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Wingdings;}@list l1:level2 lfo5	{mso-level-start-at:0;	mso-level-numbering:continue;	mso-level-text:;	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l2:level2 lfo6	{mso-level-start-at:0;	mso-level-number-format:arabic;	mso-level-numbering:continue;	mso-level-text:"%2\.";	mso-level-tab-stop:none;	mso-level-number-position:left;	margin-left:0in;	text-indent:0in;}@list l2:level2 lfo7	{mso-level-start-at:0;	mso-level-number-format:alpha-lower;	mso-level-numbering:continue;	mso-level-text:"%2\.";	mso-level-tab-stop:none;	mso-level-number-position:left;	margin-left:0in;	text-indent:0in;}@list l2:level2 lfo8	{mso-level-start-at:0;	mso-level-numbering:continue;	mso-level-text:;	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l2:level2 lfo9	{mso-level-start-at:0;	mso-level-number-format:arabic;	mso-level-numbering:continue;	mso-level-text:"%2\.";	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;}@list l5:level2 lfo10	{mso-level-start-at:0;	mso-level-number-format:arabic;	mso-level-numbering:continue;	mso-level-text:"%2\.";	mso-level-tab-stop:none;	mso-level-number-position:left;	margin-left:0in;	text-indent:0in;}@list l5:level2 lfo11	{mso-level-start-at:0;	mso-level-numbering:continue;	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:Symbol;}@list l5:level2 lfo12	{mso-level-start-at:0;	mso-level-number-format:arabic;	mso-level-numbering:continue;	mso-level-text:"%2\.";	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;}@list l5:level2 lfo13	{mso-level-start-at:0;	mso-level-numbering:continue;	mso-level-text:o;	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;	mso-ansi-font-size:10.0pt;	font-family:"Courier New";	mso-bidi-font-family:"Times New Roman";}@list l5:level2 lfo14	{mso-level-start-at:0;	mso-level-number-format:alpha-lower;	mso-level-numbering:continue;	mso-level-text:"%2\.";	mso-level-tab-stop:1.0in;	mso-level-number-position:left;	text-indent:-.25in;}ol	{margin-bottom:0in;}ul	{margin-bottom:0in;}--&gt;&lt;/style&gt;  &lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Transact-SQL Optimization Tips&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Use &lt;u&gt;views and stored procedures&lt;/u&gt; instead of heavy-duty      queries.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;This can reduce network traffic, because your client will send to server      only stored procedure or view name (perhaps with some parameters) instead      of large heavy-duty queries text. This can be used to facilitate      permission management also, because you can restrict user access to table      columns they should not see. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Try to use &lt;u&gt;constraints&lt;/u&gt; instead of triggers, whenever      possible.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;Constraints are much more efficient than triggers and can boost      performance. So, you should use constraints instead of triggers, whenever      possible. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Use &lt;u&gt;table variables &lt;/u&gt;instead of temporary tables.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;Table variables require less locking and logging resources than temporary      tables, so table variables should be used whenever possible. The table      variables are available in SQL Server 2000 only. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Try to use &lt;u&gt;UNION ALL statement&lt;/u&gt; instead of &lt;st1:place w:st="on"&gt;UNION&lt;/st1:place&gt;, whenever possible.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;The UNION ALL statement is much faster than &lt;st1:place w:st="on"&gt;UNION&lt;/st1:place&gt;,      because UNION ALL statement does not look for duplicate rows, and UNION      statement does look for duplicate rows, whether or not they exist. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Try to &lt;u&gt;avoid using the DISTINCT&lt;/u&gt; clause, whenever possible.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;Because using the DISTINCT clause will result in some performance      degradation, you should use this clause only when it is necessary. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Try to &lt;u&gt;avoid using SQL Server cursors&lt;/u&gt;, whenever possible.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;SQL Server cursors can result in some performance degradation in      comparison with select statements. Try to use correlated sub-query or      derived tables, if you need to perform row-by-row operations. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Try to &lt;u&gt;avoid the HAVING clause&lt;/u&gt;, whenever possible.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;The HAVING clause is used to restrict the result set returned by the GROUP      BY clause. When you use GROUP BY with the HAVING clause, the GROUP BY      clause divides the rows into sets of grouped rows and aggregates their      values, and then the HAVING clause eliminates undesired aggregated groups.      In many cases, you can write your select statement so, that it will contain      only WHERE and GROUP BY clauses without HAVING clause. This can improve      the performance of your query. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;If you need to return the total table's row count, you can use      alternative way instead of SELECT COUNT(*) statement.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;Because SELECT COUNT(*) statement make a full table scan to return the      total table's row count, it can take very many time for the large table.      There is another way to determine the total row count in a table. You can      use sysindexes system table, in this case. There is ROWS column in the      sysindexes table. This column contains the total row count for each table      in your database. So, you can use the following select statement instead      of SELECT COUNT(*): SELECT rows FROM sysindexes WHERE id =      OBJECT_ID('table_name') AND indid &amp;lt; 2 So, you can improve the speed of      such queries in several times. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Include &lt;u&gt;SET &lt;st1:place w:st="on"&gt;&lt;st1:city w:st="on"&gt;NOCOUNT&lt;/st1:city&gt;       &lt;st1:state w:st="on"&gt;ON&lt;/st1:state&gt;&lt;/st1:place&gt; statement into your      stored procedures &lt;/u&gt;to stop the message indicating the number of rows      affected by a T-SQL statement.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;This can reduce network traffic, because your client will not receive the      message indicating the number of rows affected by a T-SQL statement. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Try to restrict the queries result set by &lt;u&gt;using the WHERE&lt;/u&gt;      clause.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;This can results in good performance benefits, because SQL Server will      return to client only particular rows, not all rows from the table(s).      This can reduce network traffic and boost the overall performance of the      query. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Use the select statements with &lt;u&gt;TOP keyword or the SET ROWCOUNT&lt;/u&gt;      statement, if you need to return only the first n rows.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;This can improve performance of your queries, because the smaller result      set will be returned. This can also reduce the traffic between the server      and the clients. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Try to restrict the queries result set by r&lt;u&gt;eturning only the      particular columns&lt;/u&gt; from the table, not all table's columns.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;This can results in good performance benefits, because SQL Server will      return to client only particular columns, not all table's columns. This      can reduce network traffic and boost the overall performance of the query.      &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: Calibri;"&gt;1.Indexes&lt;br /&gt;2.avoid more number of triggers on the table&lt;br /&gt;3.unnecessary complicated joins&lt;br /&gt;4.correct use of Group by clause with the select list&lt;br /&gt;5.in worst cases Denormalization&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Index Optimization tips&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Every index increases the time in takes to perform INSERTS,      UPDATES and DELETES, so the number of indexes &lt;u&gt;should not be very much&lt;/u&gt;.      Try to use maximum 4-5 indexes on one table, not more. If you have      read-only table, then the number of indexes may be increased. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Keep your indexes as narrow as possible. This reduces the size of      the index and reduces the number of reads required to read the index. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Try to create indexes on columns that &lt;u&gt;have integer values&lt;/u&gt;      rather than character values. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;If you create a composite (multi-column) index, the order of the      columns in the key are very important. Try to order the columns in the key      as to enhance selectivity, with the most selective columns to the leftmost      of the key. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;If you want to join several tables, try to create surrogate      integer keys for this purpose and create indexes on their columns. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Create surrogate integer primary key (identity for example) if      your table will not have many insert operations. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Clustered indexes are more preferable than nonclustered, if you      need to select by a range of values or you need to sort results set with      GROUP BY or ORDER BY. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;If your application will be performing the same query over and      over on the same table, consider creating a covering index on the table. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;You can use the SQL Server Profiler Create Trace Wizard with      "Identify Scans of Large Tables" trace to determine which tables      in your database may need indexes. This trace will show which tables are      being scanned by queries instead of using an index. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;You can use sp_MSforeachtable undocumented stored procedure to      rebuild all indexes in your database. Try to schedule it to execute during      CPU idle time and slow production periods.&lt;br /&gt;sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?')" &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;T-SQL Queries&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;2 tables &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 0.5in; width: 20%;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="padding: 1.2pt; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Employee&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.2pt; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Phone&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="padding: 1.2pt; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;empid&lt;br /&gt;empname&lt;br /&gt;salary&lt;br /&gt;mgrid&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="padding: 1.2pt; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;empid&lt;br /&gt;phnumber&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ol start="2" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Select all employees who doesn't have phone?&lt;br /&gt;SELECT empname&lt;br /&gt;FROM Employee&lt;br /&gt;WHERE (empid NOT IN&lt;br /&gt;(SELECT DISTINCT empid&lt;br /&gt;FROM phone))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Select the employee names who is having more than one phone      numbers.&lt;br /&gt;SELECT empname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT empid&lt;br /&gt;FROM phone&lt;br /&gt;GROUP BY empid&lt;br /&gt;HAVING COUNT(empid) &amp;gt; 1)) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Select the details of 3 max salaried employees from employee      table.&lt;br /&gt;SELECT TOP 3 empid, salary&lt;br /&gt;FROM employee&lt;br /&gt;ORDER BY salary DESC &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Display all managers from the table. (manager id is same as emp      id)&lt;br /&gt;SELECT empname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT DISTINCT mgrid&lt;br /&gt;FROM employee)) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Write a Select statement to list the Employee Name, Manager Name      under a particular manager?&lt;br /&gt;SELECT e1.empname AS EmpName, e2.empname AS ManagerName&lt;br /&gt;FROM Employee e1 INNER JOIN&lt;br /&gt;Employee e2 ON e1.mgrid = e2.empid&lt;br /&gt;ORDER BY e2.mgrid &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;2 tables emp and phone.&lt;br /&gt;emp fields are - empid, name&lt;br /&gt;Ph fields are - empid, ph (office, mobile, home). Select all employees who      doesn't have any ph nos.&lt;br /&gt;SELECT *&lt;br /&gt;FROM employee LEFT OUTER JOIN&lt;br /&gt;phone ON employee.empid = phone.empid&lt;br /&gt;WHERE (phone.office IS NULL OR phone.office = ' ')&lt;br /&gt;AND (phone.mobile IS NULL OR phone.mobile = ' ')&lt;br /&gt;AND (phone.home IS NULL OR phone.home = ' ') &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Find employee who is living in more than one city. &lt;br /&gt;Two Tables: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0.5in; width: 30%;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt inset rgb(17, 17, 17); padding: 0in; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Emp&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: rgb(17, 17, 17) rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;City&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Empid&lt;br /&gt;empName&lt;br /&gt;Salary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 50%;" width="50%"&gt;&lt;div class="MsoNormal"&gt;&lt;st1:place w:st="on"&gt;&lt;st1:placename w:st="on"&gt;&lt;span style="font-family: Calibri;"&gt;Empid&lt;/span&gt;&lt;/st1:placename&gt;&lt;br /&gt;&lt;st1:placetype w:st="on"&gt;&lt;span style="font-family: Calibri;"&gt;City&lt;/span&gt;&lt;/st1:placetype&gt;&lt;/st1:place&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ol start="9" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;SELECT empname, fname, lname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT empid&lt;br /&gt;FROM city&lt;br /&gt;GROUP BY empid&lt;br /&gt;HAVING COUNT(empid) &amp;gt; 1)) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Find all employees who is living in the same city. (table is same      as above)&lt;br /&gt;SELECT fname&lt;br /&gt;FROM employee&lt;br /&gt;WHERE (empid IN&lt;br /&gt;(SELECT empid&lt;br /&gt;FROM city a&lt;br /&gt;WHERE city IN&lt;br /&gt;(SELECT city&lt;br /&gt;FROM city b&lt;br /&gt;GROUP BY city&lt;br /&gt;HAVING COUNT(city) &amp;gt; 1))) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;There is a table named MovieTable with three columns - moviename,      person and role. Write a query which gets the movie details where Mr.      Amitabh and Mr. Vinod acted and their role is actor.&lt;br /&gt;SELECT DISTINCT m1.moviename&lt;br /&gt;FROM MovieTable m1 INNER JOIN&lt;br /&gt;MovieTable m2 ON m1.moviename = m2.moviename&lt;br /&gt;WHERE (m1.person = 'amitabh' AND m2.person = 'vinod' OR&lt;br /&gt;m2.person = 'amitabh' AND m1.person = 'vinod') AND (m1.role = 'actor') AND      (m2.role = 'actor')&lt;br /&gt;ORDER BY m1.moviename &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;There are two employee tables named emp1 and emp2. Both contains      same structure (salary details). But Emp2 salary details are incorrect and      emp1 salary details are correct. So, write a query which corrects salary      details of the table emp2&lt;br /&gt;update a set a.sal=b.sal from emp1 a, emp2 b where a.empid=b.empid &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Given a Table named “Students” which contains studentid,      subjectid and marks. Where there are 10 subjects and 50 students. Write a      Query to find out the Maximum marks obtained in each subject. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;In this same tables now write a SQL Query to get the studentid      also to combine with previous results. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Three tables – student , course, marks – how do go at finding      name of the students who got max marks in the diff courses.&lt;br /&gt;SELECT student.name, course.name AS coursename, marks.sid, marks.mark&lt;br /&gt;FROM marks INNER JOIN&lt;br /&gt;student ON marks.sid = student.sid INNER JOIN&lt;br /&gt;course ON marks.cid = course.cid&lt;br /&gt;WHERE (marks.mark =&lt;br /&gt;(SELECT MAX(Mark)&lt;br /&gt;FROM Marks MaxMark&lt;br /&gt;WHERE MaxMark.cID = Marks.cID)) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;There is a table day_temp which has three columns dayid, day and      temperature. How do I write a query to get the difference of temperature      among each other for seven days of a week?&lt;br /&gt;SELECT a.dayid, a.dday, a.tempe, a.tempe - b.tempe AS Difference&lt;br /&gt;FROM day_temp a INNER JOIN&lt;br /&gt;day_temp b ON a.dayid = b.dayid + 1&lt;br /&gt;OR&lt;br /&gt;Select a.day, a.degree-b.degree from temperature a, temperature b where      a.id=b.id+1 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;There is a table which contains the names like this. a1, a2, a3,      a3, a4, a1, a1, a2 and their salaries. Write a query to get grand total      salary, and total salaries of individual employees in one query.&lt;br /&gt;SELECT empid, SUM(salary) AS salary&lt;br /&gt;FROM employee&lt;br /&gt;GROUP BY empid WITH ROLLUP&lt;br /&gt;ORDER BY empid &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How to know how many tables contains empno as a column in a      database?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SELECT COUNT(*) AS Counter&lt;br /&gt;FROM syscolumns&lt;br /&gt;WHERE (name = 'empno') &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Find duplicate rows in a table? OR I have a table with one column      which has many records which are not distinct. I need to find the distinct      values from that column and number of times it’s repeated.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;SELECT sid, mark, COUNT(*) AS Counter&lt;br /&gt;FROM marks&lt;br /&gt;GROUP BY sid, mark&lt;br /&gt;HAVING (COUNT(*) &amp;gt; 1) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How to delete the rows which are duplicate (don’t delete both      duplicate records).&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;SET ROWCOUNT 1&lt;br /&gt;DELETE yourtable&lt;br /&gt;FROM yourtable a&lt;br /&gt;WHERE (SELECT COUNT(*) FROM yourtable b WHERE b.name1 = a.name1 AND b.age1      = a.age1) &amp;gt; 1&lt;br /&gt;WHILE @@rowcount &amp;gt; 0&lt;br /&gt;&amp;nbsp; DELETE yourtable&lt;br /&gt;&amp;nbsp; FROM yourtable a&lt;br /&gt;&amp;nbsp; WHERE (SELECT COUNT(*) FROM yourtable b WHERE b.name1 = a.name1 AND      b.age1 = a.age1) &amp;gt; 1&lt;br /&gt;SET ROWCOUNT 0 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How to find 6th highest salary&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SELECT TOP 1 salary&lt;br /&gt;FROM (SELECT DISTINCT TOP 6 salary&lt;br /&gt;FROM employee&lt;br /&gt;ORDER BY salary DESC) a&lt;br /&gt;ORDER BY salary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Find top salary among two tables&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SELECT TOP 1 sal&lt;br /&gt;FROM (SELECT MAX(sal) AS sal&lt;br /&gt;FROM sal1&lt;br /&gt;UNION&lt;br /&gt;SELECT MAX(sal) AS sal&lt;br /&gt;FROM sal2) a&lt;br /&gt;ORDER BY sal DESC &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Write a query to convert all the letters in a word to upper case&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SELECT UPPER('test') &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Write a query to round up the values of a number. For example      even if the user enters 7.1 it should be rounded up to 8.&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SELECT CEILING (7.1) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Write a SQL Query to find first day of month?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SELECT DATENAME(dw,      DATEADD(dd, - DATEPART(dd, GETDATE()) + 1, GETDATE())) AS FirstDay &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0.5in; width: 192px;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt inset black; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Datepart&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: black black black -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Abbreviations&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;year&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;yy, yyyy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;quarter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;qq, q&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;month&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;mm, m&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;dayofyear&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;dy, y&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;day&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;dd, d&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;week&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;wk, ww&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;weekday&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;dw&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;hour&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;hh&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;minute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;mi, n&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;second&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;ss, s&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 70.8pt;" valign="top" width="94"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;millisecond&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 71.4pt;" valign="top" width="95"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;ms&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ol start="26" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Table A contains column1 which is primary key and has 2 values      (1, 2) and Table B contains column1 which is primary key and has 2 values      (2, 3). Write a query which returns the values that are not common for the      tables and the query should return one column with 2 records.&lt;br /&gt;SELECT tbla.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tbla.a &amp;lt;&amp;gt;&lt;br /&gt;(SELECT tblb.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tbla.a = tblb.a)&lt;br /&gt;UNION&lt;br /&gt;SELECT tblb.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tblb.a &amp;lt;&amp;gt;&lt;br /&gt;(SELECT tbla.a&lt;br /&gt;FROM tbla, tblb&lt;br /&gt;WHERE tbla.a = tblb.a)&lt;br /&gt;&lt;br /&gt;OR (better approach)&lt;br /&gt;&lt;br /&gt;SELECT a&lt;br /&gt;FROM tbla&lt;br /&gt;WHERE a NOT IN&lt;br /&gt;(SELECT a&lt;br /&gt;FROM tblb)&lt;br /&gt;&lt;st1:place w:st="on"&gt;UNION&lt;/st1:place&gt; ALL&lt;br /&gt;SELECT a&lt;br /&gt;FROM tblb&lt;br /&gt;WHERE a NOT IN&lt;br /&gt;(SELECT a&lt;br /&gt;FROM tbla) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;There are 3 tables Titles, Authors and Title-Authors (check PUBS      db). Write the query to get the author name and the number of books      written by that author, the result should start from the author who has      written the maximum number of books and end with the author who has      written the minimum number of books.&lt;br /&gt;SELECT authors.au_lname, COUNT(*) AS BooksCount&lt;br /&gt;FROM authors INNER JOIN&lt;br /&gt;titleauthor ON authors.au_id = titleauthor.au_id INNER JOIN&lt;br /&gt;titles ON titles.title_id = titleauthor.title_id&lt;br /&gt;GROUP BY authors.au_lname&lt;br /&gt;ORDER BY BooksCount DESC &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;UPDATE emp_master&lt;br /&gt;SET emp_sal = &lt;br /&gt;CASE&lt;br /&gt;WHEN emp_sal &amp;gt; 0 AND emp_sal &amp;lt;= 20000 THEN (emp_sal * 1.01) &lt;br /&gt;WHEN emp_sal &amp;gt; 20000 THEN (emp_sal * 1.02) &lt;br /&gt;END &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;List all products with total quantity ordered, if quantity      ordered is null show it as 0.&lt;br /&gt;SELECT name, CASE WHEN SUM(qty) IS NULL THEN 0 WHEN SUM(qty) &amp;gt; 0 THEN      SUM(qty) END AS tot&lt;br /&gt;FROM [order] RIGHT OUTER JOIN&lt;br /&gt;product ON [order].prodid = product.prodid&lt;br /&gt;GROUP BY name&lt;br /&gt;Result:&lt;br /&gt;coke 60&lt;br /&gt;mirinda 0&lt;br /&gt;pepsi 10 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;ANY, SOME, or ALL?&lt;br /&gt;ALL means greater than every value--in other words, greater than the      maximum value. For example, &amp;gt;ALL (1, 2, 3) means greater than 3.&lt;br /&gt;ANY means greater than at least one value, that is, greater than the      minimum. So &amp;gt;ANY (1, 2, 3) means greater than 1. SOME is an SQL-92      standard equivalent for ANY. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;IN &amp;amp; = (difference in correlated sub query)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;INDEX&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is Index? It’s purpose?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Indexes in databases are      similar to indexes in books. In a database, an index allows the database      program to find data in a table without scanning the entire table. An      index in a database is a list of values in a table with the storage      locations of rows in the table that contain each value. Indexes can be      created on either a single column or a combination of columns in a table      and are implemented in the form of B-trees. An index contains an entry      with one or more columns (the search key) from each row in a table. A      B-tree is sorted on the search key, and can be searched efficiently on any      leading subset of the search key. For example, an index on columns &lt;b&gt;A&lt;/b&gt;,      &lt;b&gt;B&lt;/b&gt;, &lt;b&gt;C&lt;/b&gt; can be searched efficiently on &lt;b&gt;A&lt;/b&gt;, on &lt;b&gt;A&lt;/b&gt;, &lt;b&gt;B&lt;/b&gt;,      and &lt;b&gt;A&lt;/b&gt;, &lt;b&gt;B&lt;/b&gt;, &lt;b&gt;C&lt;/b&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Explain about Clustered and non clustered index? How to choose      between a Clustered Index and a Non-Clustered Index?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;There are clustered and      nonclustered indexes. A clustered index is a special type of index that      reorders the way records in the table are physically stored. Therefore      table can have &lt;u&gt;only one clustered index&lt;/u&gt;. The leaf nodes of a      clustered index contain the data pages. &lt;br /&gt;A nonclustered index is a special type of index in which the logical order      of the index does not match the physical stored order of the rows on disk.      The leaf nodes of a nonclustered index does not consist of the data pages.      Instead, the leaf nodes contain index rows.&lt;br /&gt;Consider using a clustered index for: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="circle"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Columns that contain a large number of       distinct values. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Queries that return a range of values using       operators such as BETWEEN, &amp;gt;, &amp;gt;=, &amp;lt;, and &amp;lt;=. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Columns that are accessed sequentially. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Queries that return large result sets.&lt;br /&gt;Non-clustered indexes have the same B-tree structure as clustered       indexes, with two significant differences: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;The data rows are not sorted and stored in       order based on their non-clustered keys. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;The leaf layer of a non-clustered index does       not consist of the data pages. Instead, the leaf nodes contain index       rows. Each index row contains the non-clustered key value and one or more       row locators that point to the data row (or rows if the index is not       unique) having the key value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Per table only &lt;u&gt;249 non clustered &lt;/u&gt;indexes.       &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Disadvantage of index?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Every index increases the      time in takes to perform INSERTS, UPDATES and DELETES, so the number of      indexes should not be very much. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Given a scenario that I have a 10 Clustered Index in a Table to      all their 10 Columns. What are the advantages and disadvantages?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A: Only 1 clustered index is      possible. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How can I enforce to use particular index?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;You can use index hint      (index=&lt;index_name&gt;) after the table name.&lt;br /&gt;SELECT au_lname FROM authors (index=aunmind) &lt;o:p&gt;&lt;/o:p&gt;&lt;/index_name&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is Index Tuning?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;One of the hardest tasks      facing database administrators is the selection of appropriate columns for      non-clustered indexes. You should consider creating non-clustered indexes      on any columns that are frequently referenced in the WHERE clauses of SQL      statements. Other good candidates are columns referenced by JOIN and GROUP      BY operations.&lt;br /&gt;You may wish to also consider creating non-clustered indexes that cover      all of the columns used by certain frequently issued queries. These      queries are referred to as “covered queries” and experience excellent      performance gains.&lt;br /&gt;Index Tuning is the process of finding appropriate column for      non-clustered indexes.&lt;br /&gt;SQL Server provides a wonderful facility known as the Index Tuning Wizard      which greatly enhances the index selection process. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Difference between Index defrag and Index rebuild?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;When you create an index in      the database, the index information used by queries is stored in index      pages. The sequential index pages are chained together by pointers from      one page to the next. When changes are made to the data that affect the      index, the information in the index can become scattered in the database.      Rebuilding an index reorganizes the storage of the index data (and table      data in the case of a clustered index) to remove fragmentation. This can      improve disk performance by reducing the number of page reads required to      obtain the requested data&lt;br /&gt;DBCC INDEXDEFRAG - Defragments clustered and secondary indexes of the      specified table or view.&lt;br /&gt;** &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is sorting and what is the difference between sorting &amp;amp;      clustered indexes?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;The ORDER BY clause &lt;u&gt;sorts&lt;/u&gt;      query results by one or more columns up to 8,060 bytes. This will happen      by the time when we retrieve data from database. &lt;u&gt;Clustered indexes&lt;/u&gt;      physically sorting data, while inserting/updating the table. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are statistics, under what circumstances they go out of      date, how do you update them?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Statistics determine the      selectivity of the indexes. If an indexed column has unique values then      the selectivity of that index is more, as opposed to an index with      non-unique values. Query optimizer uses these indexes in determining      whether to choose an index or not while executing a query.&lt;br /&gt;Some situations under which you should update statistics:&lt;br /&gt;1) If there is significant change in the key values in the index&lt;br /&gt;2) If a large amount of data in an indexed column has been added, changed,      or removed (that is, if the distribution of key values has changed), or      the table has been truncated using the TRUNCATE TABLE statement and then      repopulated&lt;br /&gt;3) Database is upgraded from a previous version &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is fillfactor? What is the use of it ? What happens when we      ignore it? When you should use low fill factor?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;When you create a clustered      index, the data in the table is stored in the data pages of the database      according to the order of the values in the indexed columns. When new rows      of data are inserted into the table or the values in the indexed columns      are changed, Microsoft® SQL Server™ 2000 may have to reorganize the      storage of the data in the table to make room for the new row and maintain      the ordered storage of the data. This also applies to nonclustered      indexes. When data is added or changed, SQL Server may have to reorganize      the storage of the data in the nonclustered index pages. When a new row is      added to a full index page, SQL Server moves approximately half the rows      to a new page to make room for the new row. This reorganization is known      as a page split. Page splitting can impair performance and fragment the      storage of the data in a table.&lt;b&gt;&lt;br /&gt;&lt;/b&gt;When creating an index, you can specify a fill factor to leave extra      gaps and reserve a percentage of free space on each leaf level page of the      index to accommodate future expansion in the storage of the table's data      and reduce the potential for page splits. The fill factor value is a      percentage from 0 to 100 that specifies how much to fill the data pages      after the index is created. A value of 100 means the pages will be full      and will take the least amount of storage space. This setting should be      used only when there will be no changes to the data, for example, on a      read-only table. A lower value leaves more empty space on the data pages,      which reduces the need to split data pages as indexes grow but requires      more storage space. This setting is more appropriate when there will be      changes to the data in the table.&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;DATA TYPES&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are the data types in SQL &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0.5in; width: 476px;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt inset rgb(17, 17, 17); padding: 1.5pt; width: 22%;" valign="top" width="22%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;bigint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: rgb(17, 17, 17) rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 1.5pt; width: 16%;" valign="top" width="16%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Binary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: rgb(17, 17, 17) rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 1.5pt; width: 20%;" valign="top" width="20%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;bit&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: rgb(17, 17, 17) rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 1.5pt; width: 24%;" valign="top" width="24%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;char&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: rgb(17, 17, 17) rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 1.5pt; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;cursor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.5pt; width: 22%;" valign="top" width="22%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;datetime&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 16%;" valign="top" width="16%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Decimal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 20%;" valign="top" width="20%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;float&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 24%;" valign="top" width="24%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;image&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.5pt; width: 22%;" valign="top" width="22%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;money&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 16%;" valign="top" width="16%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Nchar&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 20%;" valign="top" width="20%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;ntext&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 24%;" valign="top" width="24%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;nvarchar&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;real&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.5pt; width: 22%;" valign="top" width="22%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;smalldatetime&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 16%;" valign="top" width="16%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Smallint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 20%;" valign="top" width="20%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;smallmoney&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 24%;" valign="top" width="24%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;text&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;timestamp&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.5pt; width: 22%;" valign="top" width="22%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;tinyint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 16%;" valign="top" width="16%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Varbinary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 20%;" valign="top" width="20%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Varchar&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 24%;" valign="top" width="24%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;uniqueidentifier&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.5pt; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ol start="43" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Difference between char and nvarchar / char and varchar      data-type?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;char[(n)] - Fixed-length non-Unicode character data with length of n      bytes. n must be a value from 1 through 8,000. Storage size is n bytes.      The SQL-92 synonym for char is character.&lt;br /&gt;nvarchar(n) - Variable-length Unicode character data of n characters. n      must be a value from 1 through 4,000. Storage size, in bytes, is two times      the number of characters entered. The data entered can be 0 characters in      length. The SQL-92 synonyms for nvarchar are national char varying and      national character varying. &lt;br /&gt;varchar[(n)] - Variable-length non-Unicode character data with length of n      bytes. n must be a value from 1 through 8,000. Storage size is the actual      length in bytes of the data entered, not n bytes. The data entered can be      0 characters in length. The SQL-92 synonyms for varchar are char varying      or character varying. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;GUID datasize?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;128bit &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How GUID becoming unique across machines?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;To ensure uniqueness across      machines, the ID of the network card is used (among others) to compute the      number. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is the difference between text and image data type?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Text and image. Use text for      character data if you need to store more than 255 characters in SQL Server      6.5, or more than 8000 in SQL Server 7.0. Use image for binary large      objects (BLOBs) such as digital images. With text and image data types,      the data is not stored in the row, so the limit of the page size does not      apply.All that is stored in the row is a pointer to the database pages      that contain the data.Individual text, ntext, and image values can be a      maximum of 2-GB, which is too long to store in a single data row.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JOINS&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are joins?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Sometimes we have to select      data from two or more tables to make our result complete. We have to      perform a join. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How many types of Joins?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Joins can be categorized as: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start="48" type="1"&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Inner joins (the typical join operation,       which uses some comparison operator like = or &amp;lt;&amp;gt;). These include       equi-joins and natural joins. &lt;br /&gt;Inner joins use a comparison operator to match rows from two tables based       on the values in common columns from each table. For example, retrieving       all rows where the student identification number is the same in both the &lt;b&gt;students       &lt;/b&gt;and &lt;b&gt;courses &lt;/b&gt;tables. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Outer joins. Outer joins can be a left, a       right, or full outer join. &lt;br /&gt;Outer joins are specified with one of the following sets of keywords when       they are specified in the FROM clause: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;LEFT JOIN or LEFT OUTER JOIN -The result set        of a left outer join includes all the rows from the left table specified        in the LEFT OUTER clause, not just the ones in which the joined columns        match. When a row in the left table has no matching rows in the right        table, the associated result set row contains null values for all select        list columns coming from the right table. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;RIGHT JOIN or RIGHT OUTER JOIN&amp;nbsp;- A        right outer join is the reverse of a left outer join. All rows from the        right table are returned. Null values are returned for the left table        any time a right table row has no matching row in the left table. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;FULL JOIN or FULL OUTER JOIN&amp;nbsp;- A full        outer join returns all rows in both the left and right tables. Any time        a row has no match in the other table, the select list columns from the        other table contain null values. When there is a match between the        tables, the entire result set row contains data values from the base        tables. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Cross joins&amp;nbsp;- Cross joins return all       rows from the left table, each row from the left table is combined with all       rows from the right table. Cross joins are also called &lt;b&gt;Cartesian       products.&lt;/b&gt; (A Cartesian join will get you a Cartesian product. A       Cartesian join is when you join every row of one table to every row of       another table. You can also get one by joining every row of a table to       every row of itself.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is self join?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A table can be joined to      itself in a self-join. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are the differences between UNION and JOINS?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A join selects columns from 2      or more tables. A union selects rows. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Can I improve performance by using the ANSI-style joins instead      of the old-style joins?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;u&gt;&lt;span style="font-family: Calibri;"&gt;Code Example 1:&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family: Calibri;"&gt;select o.name, i.name&lt;br /&gt;from sysobjects o, sysindexes i&lt;br /&gt;where o.id = i.id&lt;br /&gt;&lt;u&gt;Code Example 2:&lt;br /&gt;&lt;/u&gt;select o.name, i.name&lt;br /&gt;from sysobjects o inner join sysindexes i&lt;br /&gt;on o.id = i.id&lt;br /&gt;You will not get any performance gain by switching to the ANSI-style JOIN      syntax.&lt;br /&gt;Using the ANSI-JOIN syntax gives you an important advantage: Because the      join logic is cleanly separated from the filtering criteria, you can      understand the query logic more quickly.&lt;br /&gt;The SQL Server old-style JOIN executes the filtering conditions before      executing the joins, whereas the ANSI-style JOIN reverses this procedure      (join logic precedes filtering).&lt;br /&gt;Perhaps the most compelling argument for switching to the ANSI-style JOIN      is that Microsoft has explicitly stated that SQL Server will not support      the old-style OUTER JOIN syntax indefinitely. Another important      consideration is that the ANSI-style JOIN supports query constructions      that the old-style JOIN syntax does not support. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin-bottom: 12pt;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is derived table?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Derived tables are SELECT      statements in the FROM clause referred to by an alias or a user-specified      name. The result set of the SELECT in the FROM clause forms a table used      by the outer SELECT statement. For example, this SELECT uses a derived      table to find if any store carries all book titles in the &lt;b&gt;pubs&lt;/b&gt;      database: &lt;br /&gt;SELECT ST.stor_id, ST.stor_name&lt;br /&gt;FROM stores AS ST,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT stor_id, COUNT(DISTINCT title_id) AS      title_count&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM sales&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY stor_id&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) AS SA&lt;br /&gt;WHERE ST.stor_id = SA.stor_id&lt;br /&gt;AND SA.title_count = (SELECT COUNT(*) FROM titles)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;STORED PROCEDURE&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol start="53" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is Stored procedure?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A stored procedure is a set      of Structured Query Language (SQL) statements that you assign a name to      and store in a database in compiled form so that you can share it between      a number of programs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;They allow modular programming. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;They allow faster execution. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;They can reduce network traffic. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;They can be used as a security mechanism. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are the different types of Storage Procedure?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;a.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;Temporary Stored Procedures - SQL Server supports two types of temporary procedures: local and global. A local temporary procedure is visible only to the connection that created it. A global temporary procedure is available to all connections. Local temporary procedures are automatically dropped at the end of the current session. Global temporary procedures are dropped at the end of the last session using the procedure. Usually, this is when the session that created the procedure ends. Temporary procedures named with # and ## can be created by any user. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;b.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;System stored procedures are created and stored in the &lt;b&gt;master&lt;/b&gt; database and have the &lt;b&gt;sp_&lt;/b&gt; prefix.(or xp_) System stored procedures can be executed from any database without having to qualify the stored procedure name fully using the database name &lt;b&gt;master&lt;/b&gt;. (If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;c.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;Automatically Executing Stored Procedures - One or more stored procedures can execute automatically when SQL Server starts. The stored procedures must be created by the system administrator and executed under the &lt;b&gt;sysadmin&lt;/b&gt; fixed server role as a background process. The procedure(s) cannot have any input parameters. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;d.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;User stored procedure &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol start="55" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How do I mark the stored procedure to automatic execution? &lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;You can use the sp_procoption      system stored procedure to mark the stored procedure to automatic      execution when the SQL Server will start. Only objects in the master      database owned by dbo can have the startup setting changed and this option      is restricted to objects that have no parameters.&lt;br /&gt;USE master&lt;br /&gt;EXEC sp_procoption 'indRebuild', 'startup', 'true') &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How can you optimize a stored procedure?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How will know whether the SQL statements are executed?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;When used in a stored      procedure, the RETURN statement can specify an integer value to return to      the calling application, batch, or procedure. If no value is specified on      RETURN, a stored procedure returns the value 0.&amp;nbsp; The stored      procedures return a value of 0 when no errors were encountered. Any      nonzero value indicates an error occurred. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Why one should not prefix user stored procedures with sp_?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;It is strongly recommended      that you do not create any stored procedures using sp_ as a prefix. SQL Server      always looks for a stored procedure beginning with sp_ in this order: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;The stored procedure in the master database. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;The stored procedure based on any qualifiers provided (database name or owner). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;The stored procedure using dbo as the owner, if one is not specified. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: Calibri;"&gt;Therefore, although the user-created stored procedure prefixed with sp_ may exist in the current database, the master database is always checked first, even if the stored procedure is qualified with the database name. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol start="59" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What can cause a Stored procedure execution plan to become      invalidated and/or fall out of cache?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Server restart &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Plan is aged out due to low use &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;DBCC FREEPROCCACHE (sometime desired to force       it) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;When do one need to recompile stored procedure?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;if a new index is added from which      the stored procedure might benefit, optimization does not automatically      happen (until the next time the stored procedure is run after SQL Server      is restarted). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;SQL Server provides three ways to recompile a stored procedure: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start="1" type="1"&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;The &lt;b&gt;sp_recompile&lt;/b&gt; system stored       procedure forces a recompile of a stored procedure the next time it is       run. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Creating a stored procedure that specifies       the WITH RECOMPILE option in its definition indicates that SQL Server       does not cache a plan for this stored procedure; the stored procedure is       recompiled each time it is executed. Use the WITH RECOMPILE option when       stored procedures take parameters whose values differ widely between       executions of the stored procedure, resulting in different execution       plans to be created each time. Use of this option is uncommon, and causes       the stored procedure to execute more slowly because the stored procedure       must be recompiled each time it is executed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;You can force the stored procedure to be       recompiled by specifying the WITH RECOMPILE option when you execute the       stored procedure. Use this option only if the parameter you are supplying       is atypical or if the data has significantly changed since the stored       procedure was created. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;ol start="62" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How to find out which stored procedure is recompiling? How to      stop stored procedures from recompiling? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;I have Two Stored Procedures SP1 and SP2 as given below. How the      Transaction works, whether SP2 Transaction succeeds or fails?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;CREATE PROCEDURE SP1 AS&lt;br /&gt;BEGIN TRAN&lt;br /&gt;INSERT INTO MARKS (SID,MARK,CID) VALUES (5,6,3)&lt;br /&gt;EXEC SP2&lt;br /&gt;ROLLBACK&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE SP2 AS&lt;br /&gt;BEGIN TRAN&lt;br /&gt;INSERT INTO MARKS (SID,MARK,CID) VALUES (100,100,103)&lt;br /&gt;commit tran&lt;br /&gt;GO&lt;br /&gt;Both will get roll backed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;CREATE PROCEDURE SP1 AS&lt;br /&gt;BEGIN TRAN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT INTO MARKS (SID,MARK,CID) VALUES (5,6,3)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEGIN TRAN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT INTO STUDENT (SID,NAME1)      VALUES (1,'SA')&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; commit tran&lt;br /&gt;ROLLBACK TRAN&lt;br /&gt;GO&lt;br /&gt;Both will get roll backed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How will you handle Errors in Sql Stored Procedure?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;INSERT NonFatal VALUES      (@Column2)&lt;br /&gt;IF @@ERROR &amp;lt;&amp;gt;0&lt;br /&gt;&amp;nbsp;BEGIN&lt;br /&gt;&amp;nbsp; PRINT 'Error Occured'&lt;br /&gt;&amp;nbsp;END &lt;br /&gt;&lt;a href="http://www.sqlteam.com/item.asp?ItemID=2463"&gt;http://www.sqlteam.com/item.asp?ItemID=2463&lt;/a&gt;      &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How will you raise an error in sql?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;RAISERROR - Returns a      user-defined error message and sets a system flag to record that an error      has occurred. Using RAISERROR, the client can either retrieve an entry      from the sysmessages table or build a message dynamically with      user-specified severity and state information. After the message is      defined it is sent back to the client as a server error message. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;I have a stored procedure like&lt;br /&gt;commit tran&lt;br /&gt;create table a()&lt;br /&gt;insert into table b&lt;br /&gt;--&lt;br /&gt;--&lt;br /&gt;rollback tran&lt;br /&gt;what will be the result? Is table created? data will be inserted in table      b? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What do you do when one procedure is blocking the other?&lt;br /&gt;**&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How you will return XML from Stored Procedure?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;You use the FOR XML clause of      the SELECT statement, and within the FOR XML clause you specify an XML      mode: RAW, AUTO, or EXPLICIT. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are the differences between RAW, AUTO and Explicit modes in      retrieving data from SQL Server in XML format?&lt;br /&gt;**&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Can a Stored Procedure call itself (recursive). If so then up to      what level and can it be control?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Stored procedures are nested      when one stored procedure calls another. You can nest stored procedures up      to 32 levels. The nesting level increases by one when the called stored      procedure begins execution and decreases by one when the called stored      procedure completes execution. Attempting to exceed the maximum of 32      levels of nesting causes the whole calling stored procedure chain to fail.      The current nesting level for the stored procedures in execution is stored      in the @@NESTLEVEL function.&lt;br /&gt;eg:&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;USE master&lt;br /&gt;IF OBJECT_ID('dbo.sp_calcfactorial') IS NOT NULL&lt;br /&gt;DROP PROC dbo.sp_calcfactorial&lt;br /&gt;GO&lt;br /&gt;CREATE PROC dbo.sp_calcfactorial&lt;br /&gt;@base_number int, @factorial int OUT&lt;br /&gt;AS&lt;br /&gt;DECLARE @previous_number int&lt;br /&gt;IF (@base_number&amp;lt;2) SET @factorial=1 -- Factorial of 0 or 1=1&lt;br /&gt;ELSE BEGIN&lt;br /&gt;SET @previous_number=@base_number-1&lt;br /&gt;EXEC dbo.sp_calcfactorial @previous_number, @factorial OUT -- &lt;b&gt;Recursive&lt;/b&gt;      call&lt;br /&gt;IF (@factorial=-1) RETURN(-1) -- Got an error, return&lt;br /&gt;SET @factorial=@factorial*@base_number&lt;br /&gt;END&lt;br /&gt;RETURN(0)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;calling proc.&lt;br /&gt;DECLARE @factorial int &lt;br /&gt;EXEC dbo.sp_calcfactorial 4, @factorial OUT &lt;br /&gt;SELECT @factorial &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Nested Triggers&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Triggers are nested when a      trigger performs an action that initiates another trigger, which can      initiate another trigger, and so on. Triggers can be nested up to 32      levels, and you can control whether triggers can be nested through the      nested triggers server configuration option. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is an extended stored procedure? Can you instantiate a COM      object by using T-SQL? &lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;An extended stored procedure      is a function within a DLL (written in a programming language like C, C++      using Open Data Services (ODS) API) that can be called from T-SQL, just      the way we call normal stored procedures using the EXEC statement. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Difference between view and stored procedure?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Views can have only select      statements (create, update, truncate, delete statements are not allowed)      Views cannot have “select into”, “Group by” “Having”, ”Order by” &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is a Function &amp;amp; what are the different user defined      functions?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Function is a saved      Transact-SQL routine that returns a value. User-defined functions cannot      be used to perform a set of actions that modify the global database state.      User-defined functions, like system functions, can be invoked from a      query. They also can be executed through an EXECUTE statement like stored      procedures. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start="1" type="1"&gt;&lt;ol start="11" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Scalar Functions&lt;br /&gt;Functions are scalar-valued if the RETURNS clause specified one of the       scalar &lt;u&gt;data types&lt;/u&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Inline Table-valued Functions&lt;br /&gt;If the &lt;u&gt;RETURNS clause specifies TABLE&lt;/u&gt; with no accompanying column       list, the function is an inline function. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Multi-statement Table-valued Functions&lt;br /&gt;If the &lt;u&gt;RETURNS clause specifies a TABLE type with columns and their       data types&lt;/u&gt;, the function is a multi-statement table-valued function. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;ol start="76" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are the difference between a function and a stored      procedure?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Functions &lt;u&gt;can be used in a select       statement&lt;/u&gt; where as procedures cannot &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Procedure takes &lt;u&gt;both input and output&lt;/u&gt;       parameters but Functions takes only input parameters &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Functions &lt;u&gt;cannot return values of type       text, ntext, image &amp;amp; timestamps&lt;/u&gt; where as procedures can &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Functions can be used as user defined       datatypes in create table but procedures cannot &lt;br /&gt;***Eg:-create table &lt;tablename&gt;(name varchar(10),salary       getsal(name))&lt;br /&gt;Here getsal is a user defined function which returns a salary type, when       table is created no storage is allotted for salary type, and getsal       function is also not executed, But when we are fetching some values from       this table, getsal function get’s executed and the return &lt;br /&gt;Type is returned as the result set. &lt;o:p&gt;&lt;/o:p&gt;&lt;/tablename&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;How to debug a stored procedure?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;TRIGGER&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is Trigger? What is its use? What are the types of Triggers?      What are the new kinds of triggers in sql 2000?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Triggers are a special class      of stored procedure &lt;u&gt;defined to execute automatically when an UPDATE,      INSERT, or DELETE statement is issued against a table or view&lt;/u&gt;.      Triggers are powerful tools that sites can &lt;u&gt;use to enforce their      business rules automatically when data is modified&lt;/u&gt;.&lt;br /&gt;The CREATE TRIGGER statement can be defined with the FOR UPDATE, FOR      INSERT, or FOR DELETE clauses to target a trigger to a specific class of      data modification actions. When FOR UPDATE is specified, the &lt;u&gt;IF UPDATE      (column_name) clause&lt;/u&gt; can be used to target a trigger to updates      affecting a particular column.&lt;br /&gt;You can use the FOR clause to specify when a trigger is executed: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;AFTER (default) - The trigger &lt;u&gt;executes       after the statement that triggered it completes&lt;/u&gt;. If the statement       fails with an error, such as a constraint violation or syntax error, the       trigger is not executed. AFTER triggers cannot be specified for views. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;INSTEAD OF -The trigger executes in place of       the triggering action. INSTEAD OF triggers can be specified on both       tables and views. You can define &lt;u&gt;only one INSTEAD OF trigger for each       triggering action&lt;/u&gt; (INSERT, UPDATE, and DELETE). INSTEAD OF triggers       can be used to perform enhance integrity checks on the data values       supplied in INSERT and UPDATE statements. INSTEAD OF triggers also let       you specify actions that allow views, which would normally not support       updates, to be updatable.&lt;br /&gt;An INSTEAD OF trigger can take actions such as: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Ignoring parts of a batch. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Not processing a part of a batch and logging        the problem rows. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Taking an alternative action if an error        condition is encountered. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: Calibri;"&gt;In SQL Server 6.5 you could define only 3 triggers per table, one for INSERT, one for UPDATE and one for DELETE. From SQL Server 7.0 onwards, this restriction is gone, and you could create multiple triggers per each action. But in 7.0 there's no way to control the order in which the triggers fire. In SQL Server 2000 you could specify &lt;u&gt;which trigger fires first or fires last using sp_settriggerorder&lt;/u&gt;.&lt;br /&gt;Till SQL Server 7.0, triggers fire only after the data modification operation happens. So in a way, they are called post triggers. But in SQL Server 2000 you could create pre triggers also. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol start="79" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;When should one use "instead of Trigger"? Example&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;CREATE TABLE BaseTable&lt;br /&gt;(&lt;br /&gt;PrimaryKey int IDENTITY(1,1),&lt;br /&gt;Color nvarchar(10) NOT NULL,&lt;br /&gt;Material nvarchar(10) NOT NULL,&lt;br /&gt;ComputedCol AS (Color + Material)&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;--Create a view that contains all columns from the base table.&lt;br /&gt;CREATE VIEW InsteadView&lt;br /&gt;AS SELECT PrimaryKey, Color, Material, ComputedCol&lt;br /&gt;FROM BaseTable&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;--Create an INSTEAD OF INSERT trigger on tthe view.&lt;br /&gt;CREATE TRIGGER InsteadTrigger on InsteadView&lt;br /&gt;INSTEAD OF INSERT&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;--Build an INSERT statement ignoring inserrted.PrimaryKey and &lt;br /&gt;--inserted.ComputedCol.&lt;br /&gt;INSERT INTO BaseTable&lt;br /&gt;SELECT Color, Material&lt;br /&gt;FROM inserted&lt;br /&gt;END&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;-- can insert value to basetable by this insert into      basetable(color,material) values ('red','abc')&lt;br /&gt;&lt;br /&gt;-- insert into InsteadView(color,material)) values ('red','abc') can't do      this.&lt;br /&gt;-- It will give error "'PrimaryKey' iin table 'InsteadView' cannot be      null."&lt;br /&gt;&lt;br /&gt;-- can insert value through table by this&amp;lt;&lt;br /&gt;insert into InsteadView values (1,'red','abc',1) --PrimaryKey, ComputedCol      wont take values from here &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Difference between trigger and stored procedure?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Trigger will get execute      automatically when an UPDATE, INSERT, or DELETE statement is issued      against a table or view.&lt;br /&gt;We have to call stored procedure manually, or it can execute automatic      when the SQL Server starts (You can use the sp_procoption system stored      procedure to mark the stored procedure to automatic execution when the SQL      Server will start. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;The following trigger generates an e-mail whenever a new title is      added.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;CREATE TRIGGER reminder&lt;br /&gt;ON titles&lt;br /&gt;FOR INSERT&lt;br /&gt;AS&lt;br /&gt;EXEC master..xp_sendmail 'MaryM', 'New title, mention in the next report      to distributors.' &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Drawback of trigger? Its alternative solution?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Triggers are generally used      to implement business rules, auditing. Triggers can also be used to extend      the referential integrity checks, but wherever possible, use constraints      for this purpose, instead of triggers, as constraints are much faster.&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;LOCK&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are locks?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Microsoft® SQL Server™ 2000      uses locking to ensure transactional integrity and database consistency.      Locking prevents users from reading data being changed by other users, and      prevents multiple users from changing the same data at the same time. If      locking is not used, data within the database may become logically      incorrect, and queries executed against that data may produce unexpected      results. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are the different types of locks?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SQL Server uses these      resource lock modes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0.5in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt inset black; padding: 0in;" valign="top"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Lock mode&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: black black black -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 0in;" valign="top"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in;"&gt;&lt;span style="font-family: Calibri;"&gt;Shared (S)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Used for operations that   do not change or update data (read-only operations), such as a SELECT   statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Update (U)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Used on resources that   can be updated. Prevents a common form of deadlock that occurs when multiple   sessions are reading, locking, and potentially updating resources later.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Exclusive (X)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Used for   data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that   multiple updates cannot be made to the same resource at the same time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Intent&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Used to establish a lock   hierarchy. The types of intent locks are: intent shared (IS), intent   exclusive (IX), and shared with intent exclusive (SIX).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Schema&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Used when an operation   dependent on the schema of a table is executing. The types of schema locks   are: schema modification (Sch-M) and schema stability (Sch-S). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Bulk Update (BU)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in;"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Used when bulk-copying   data into a table and the TABLOCK hint is specified.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ol start="85" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is a dead lock? Give a practical sample? How you can      minimize the deadlock situation? What is a deadlock and what is a live      lock? How will you go about resolving deadlocks?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Deadlock is a situation when      two processes, &lt;u&gt;each having a lock on one piece of data, attempt to      acquire a lock on the other's piece&lt;/u&gt;. Each process&amp;nbsp; would wait indefinitely      for the other to release the lock, unless one of the user processes is      terminated. SQL Server detects deadlocks and terminates one user's      process.&lt;br /&gt;A livelock is one, where a&amp;nbsp;&lt;u&gt;request for an exclusive lock is      repeatedly denied because a series of overlapping shared locks keeps      interfering&lt;/u&gt;. SQL Server detects the situation after four denials and &lt;u&gt;refuses      further shared locks&lt;/u&gt;. (A livelock also occurs when read transactions      monopolize a table or page, forcing a write transaction to wait      indefinitely.) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is isolation level?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;An isolation level determines      the degree of isolation of data between concurrent transactions. The      default SQL Server isolation level is Read Committed. A lower isolation      level increases concurrency, but at the expense of data correctness.      Conversely, a higher isolation level ensures that data is correct, but can      affect concurrency negatively. The isolation level required by an      application determines the locking behavior SQL Server uses.&lt;br /&gt;SQL-92 defines the following isolation levels, all of which are supported      by SQL Server: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Read uncommitted (the lowest level where       transactions are isolated only enough to ensure that physically corrupt       data is not read). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Read committed (SQL Server default level). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Repeatable read. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Serializable (the highest level, where       transactions are completely isolated from one another). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0.5in; width: 470px;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt inset black; padding: 0in; width: 30%;" valign="top" width="30%"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Isolation level&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: black black black -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 21%;" valign="top" width="21%"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Dirty read&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: black black black -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 31%;" valign="top" width="31%"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Nonrepeatable read&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: black black black -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 18%;" valign="top" width="18%"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Phantom&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in; width: 30%;" valign="top" width="30%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Read uncommitted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 21%;" valign="top" width="21%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 31%;" valign="top" width="31%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in; width: 30%;" valign="top" width="30%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Read committed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 21%;" valign="top" width="21%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 31%;" valign="top" width="31%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in; width: 30%;" valign="top" width="30%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Repeatable read&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 21%;" valign="top" width="21%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 31%;" valign="top" width="31%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color black black; border-style: none inset inset; border-width: medium 1pt 1pt; padding: 0in; width: 30%;" valign="top" width="30%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Serializable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 21%;" valign="top" width="21%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 31%;" valign="top" width="31%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color black black -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 0in; width: 18%;" valign="top" width="18%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ol start="87" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;u&gt;&lt;span style="font-family: Calibri;"&gt;Uncommitted Dependency (Dirty Read)&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family: Calibri;"&gt; - Uncommitted dependency occurs when a second      transaction selects a row that is being updated by another transaction.      The second transaction is reading data that has not been committed yet and      may be changed by the transaction updating the row. For example, an editor      is making changes to an electronic document. During the changes, a second      editor takes a copy of the document that includes all the changes made so      far, and distributes the document to the intended audience.&lt;br /&gt;&lt;u&gt;Inconsistent Analysis (Nonrepeatable Read)&lt;/u&gt; Inconsistent analysis      occurs when a second transaction accesses the same row several times and      reads different data each time. Inconsistent analysis is similar to      uncommitted dependency in that another transaction is changing the data      that a second transaction is reading. However, in inconsistent analysis,      the data read by the second transaction was committed by the transaction      that made the change. Also, inconsistent analysis involves multiple reads      (two or more) of the same row and each time the information is changed by      another transaction; thus, the term nonrepeatable read. For example, an      editor reads the same document twice, but between each reading, the writer      rewrites the document. When the editor reads the document for the second      time, it has changed.&lt;br /&gt;&lt;u&gt;Phantom Reads&lt;/u&gt; Phantom reads occur when an insert or delete action      is performed against a row that belongs to a range of rows being read by a      transaction. The transaction's first read of the range of rows shows a row      that no longer exists in the second or succeeding read, as a result of a      deletion by a different transaction. Similarly, as the result of an insert      by a different transaction, the transaction's second or succeeding read      shows a row that did not exist in the original read. For example, an      editor makes changes to a document submitted by a writer, but when the      changes are incorporated into the master copy of the document by the      production department, they find that new unedited material has been added      to the document by the author. This problem could be avoided if no one      could add new material to the document until the editor and production      department finish working with the original document. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;nolock? What is the difference between the REPEATABLE READ and      SERIALIZE isolation levels?&lt;br /&gt;Locking Hints - &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A range of      table-level locking hints can be specified using the SELECT, INSERT,      UPDATE, and DELETE statements to direct Microsoft® SQL Server 2000 to the      type of locks to be used. Table-level locking hints can be used when a      finer control of the types of locks acquired on an object is required.      These locking hints override the current transaction isolation level for      the session. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none; margin-left: 0.5in; width: 80%;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt inset rgb(17, 17, 17); padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Locking hint&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: rgb(17, 17, 17) rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: inset inset inset none; border-width: 1pt 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;HOLDLOCK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Hold a shared lock until   completion of the transaction instead of releasing the lock as soon as the   required table, row, or data page is no longer required. HOLDLOCK is   equivalent to SERIALIZABLE.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;NOLOCK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Do not issue shared   locks and do not honor exclusive locks. When this option is in effect, it is   possible to read an uncommitted transaction or a set of pages that are rolled   back in the middle of a read. Dirty reads are possible. Only applies to the   SELECT statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;PAGLOCK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Use page locks where a   single table lock would usually be taken.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;READCOMMITTED&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Perform a scan with the   same locking semantics as a transaction running at the READ COMMITTED   isolation level. By default, SQL Server 2000 operates at this isolation   level.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;READPAST&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Skip locked rows. This   option causes a transaction to skip rows locked by other transactions that   would ordinarily appear in the result set, rather than block the transaction   waiting for the other transactions to release their locks on these rows. The   READPAST lock hint applies only to transactions operating at READ COMMITTED   isolation and will read only past row-level locks. Applies only to the SELECT   statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;READUNCOMMITTED&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Equivalent to NOLOCK.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;REPEATABLEREAD&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Perform a scan with the   same locking semantics as a transaction running at the REPEATABLE READ   isolation level. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;ROWLOCK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Use row-level locks   instead of the coarser-grained page- and table-level locks.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;SERIALIZABLE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Perform a scan with the   same locking semantics as a transaction running at the SERIALIZABLE isolation   level. Equivalent to HOLDLOCK.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;TABLOCK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Use a table lock instead   of the finer-grained row- or page-level locks. SQL Server holds this lock   until the end of the statement. However, if you also specify HOLDLOCK, the   lock is held until the end of the transaction.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;TABLOCKX&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Use an exclusive lock on   a table. This lock prevents others from reading or updating the table and is   held until the end of the statement or transaction.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;UPDLOCK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Use update locks instead   of shared locks while reading a table, and hold locks until the end of the   statement or transaction. UPDLOCK has the advantage of allowing you to read   data (without blocking other readers) and update it later with the assurance   that the data has not changed since you last read it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17); border-style: none inset inset; border-width: medium 1pt 1pt; padding: 1.2pt; width: 105pt;" valign="top" width="140"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;XLOCK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color rgb(17, 17, 17) rgb(17, 17, 17) -moz-use-text-color; border-style: none inset inset none; border-width: medium 1pt 1pt medium; padding: 1.2pt; width: 79%;" valign="top" width="79%"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Use an exclusive lock   that will be held until the end of the transaction on all data processed by   the statement. This lock can be specified with either PAGLOCK or TABLOCK, in   which case the exclusive lock applies to the appropriate level of   granularity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ol start="89" type="1"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;For example, if the transaction isolation level is set to      SERIALIZABLE, and the table-level locking hint NOLOCK is used with the      SELECT statement, key-range locks typically used to maintain serializable      transactions are not taken.&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;USE pubs&lt;br /&gt;GO&lt;br /&gt;SET TRANSACTION ISOLATION LEVEL SERIALIZABLE&lt;br /&gt;GO&lt;br /&gt;BEGIN TRANSACTION&lt;br /&gt;SELECT au_lname FROM authors WITH (NOLOCK)&lt;br /&gt;GO &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is escalation of locks?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Lock escalation is the      process of converting a lot of low level locks (like row locks, page      locks) into higher level locks (like table locks). Every lock is a memory      structure too many locks would mean, more memory being occupied by locks.      To prevent this from happening, SQL Server escalates the many fine-grain      locks to fewer coarse-grain locks. Lock escalation threshold was definable      in SQL Server 6.5, but from SQL Server 7.0 onwards it's dynamically managed      by SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;VIEW&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is View? Use? Syntax of View?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A view is a virtual table      made up of data from base tables and other views, but not stored      separately. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Views simplify users perception of the       database (can be used to present only the necessary information while       hiding details in underlying relations) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Views improve data security preventing       undesired accesses &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Views facilite the provision of additional       data independence &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Does the View occupy memory space?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;No &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Can u drop a table if it has a view?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Views or tables participating      in a view created &lt;u&gt;with the SCHEMABINDING clause cannot be dropped&lt;/u&gt;.      If the view is not created using SCHEMABINDING, then we can drop the      table. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Why doesn't SQL Server permit an ORDER BY clause in the      definition of a view?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SQL Server excludes an ORDER      BY clause from a view to comply with the ANSI SQL-92 standard. Because      analyzing the rationale for this standard requires a discussion of the      underlying structure of the structured query language (SQL) and the      mathematics upon which it is based, we can't fully explain the restriction      here. However, if you need to be able to specify an ORDER BY clause in a      view, consider using the following workaround:&lt;br /&gt;USE pubs&lt;br /&gt;GO &lt;br /&gt;CREATE VIEW AuthorsByName&lt;br /&gt;AS&lt;br /&gt;SELECT TOP 100 PERCENT *&lt;br /&gt;FROM authors &lt;br /&gt;ORDER BY au_lname, au_fname&lt;br /&gt;GO&lt;br /&gt;The TOP construct, which Microsoft introduced in SQL Server 7.0, is most      useful when you combine it with the ORDER BY clause. The only time that      SQL Server supports an ORDER BY clause in a view is when it is used in      conjunction with the TOP keyword. (Note that the TOP keyword is a SQL      Server extension to the ANSI SQL-92 standard.)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;TRANSACTION&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is Transaction?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A transaction is a sequence      of operations performed as a single logical unit of work. A logical unit      of work must exhibit four properties, called the ACID (Atomicity,      Consistency, Isolation, and Durability) properties, to qualify as a      transaction: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Atomicity - &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;A transaction must be an atomic unit of work;       &lt;u&gt;either all of its data modifications are performed or none &lt;/u&gt;of them       is performed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Consistency - &lt;/span&gt;&lt;/b&gt;&lt;u&gt;&lt;span style="font-family: Calibri;"&gt;When completed, a transaction must leave all       data in a consistent&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family: Calibri;"&gt; state.       In a relational database, all rules must be applied to the transaction's       modifications to maintain all data integrity. All internal data       structures, such as B-tree indexes or doubly-linked lists, must be       correct at the end of the transaction. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Isolation - &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Modifications &lt;u&gt;made by concurrent       transactions must be isolated&lt;/u&gt; from the modifications made by any       other concurrent transactions. A transaction either sees data in the       state it was in before another concurrent transaction modified it, or it       sees the data after the second transaction has completed, but it does not       see an intermediate state. This is referred to as serializability because       it results in the ability to reload the starting data and replay a series       of transactions to end up with the data in the same state it was in after       the original transactions were performed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Durability - &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;After a transaction has completed, its &lt;u&gt;effects       are permanently&lt;/u&gt; in place in the system. The modifications persist       even in the event of a system failure. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;After one Begin Transaction a truncate statement and a RollBack      statements are there.&amp;nbsp;Will it be rollbacked? Since the truncate      statement does not perform logged operation how does it RollBack?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;It will rollback.&lt;br /&gt;** &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Given a SQL like &lt;br /&gt;Begin Tran&lt;br /&gt;&amp;nbsp;&amp;nbsp; Select @@Rowcount&lt;br /&gt;Begin Tran&lt;br /&gt;&amp;nbsp;&amp;nbsp; Select @@Rowcount&lt;br /&gt;Begin Tran&lt;br /&gt;&amp;nbsp;&amp;nbsp; Select @@Rowcount&lt;br /&gt;Commit Tran&lt;br /&gt;&amp;nbsp;&amp;nbsp; Select @@Rowcount&lt;br /&gt;RollBack&lt;br /&gt;&amp;nbsp;&amp;nbsp; Select @@Rowcount&lt;br /&gt;RollBack&lt;br /&gt;&amp;nbsp;&amp;nbsp; Select @@Rowcount&lt;br /&gt;What is the value of @@Rowcount at each stmt levels?&lt;br /&gt;Ans : 0 – zero.&lt;br /&gt;@@ROWCOUNT - Returns the number of rows affected by the last statement.&lt;br /&gt;@@TRANCOUNT - Returns the number of active transactions for the current      connection.&lt;br /&gt;Each Begin Tran will add count, each commit will reduce count and ONE      rollback will make it 0.&lt;br /&gt;&lt;br /&gt;OTHER &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are the constraints for Table Constraints define rules      regarding the values allowed in columns and are the standard mechanism for      enforcing integrity. SQL Server 2000 supports five classes of constraints.&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;NOT NULL&lt;br /&gt;CHECK&lt;br /&gt;UNIQUE&lt;br /&gt;PRIMARY KEY&lt;br /&gt;FOREIGN KEY &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;There are 50 columns in a table. Write a query to get first 25      columns&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Ans: Need to mention each      column names. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How to list all the tables in a particular database?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;USE pubs&lt;br /&gt;GO&lt;br /&gt;sp_help &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are cursors? Explain different types of cursors. What are      the disadvantages of cursors? How can you avoid cursors?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Cursors allow row-by-row      processing of the result sets.&lt;br /&gt;&lt;u&gt;Types&lt;/u&gt; of cursors: Static, Dynamic, Forward-only, Keyset-driven.&lt;br /&gt;&lt;u&gt;Disadvantages&lt;/u&gt; of cursors: Each time you fetch a row from the      cursor, it results in a network roundtrip. Cursors are also costly because      they require more resources and temporary storage (results in more IO      operations). Further, there are restrictions on the SELECT statements that      can be used with some types of cursors.&lt;br /&gt;&lt;u&gt;How to avoid cursor:&lt;/u&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Most of the times, set based operations can       be used instead of cursors. Here is an example: If you have to give a       flat hike to your employees using the following criteria:&lt;br /&gt;Salary between 30000 and 40000 -- 5000 hike&lt;br /&gt;Salary between 40000 and 55000 -- 7000 hike&lt;br /&gt;Salary between 55000 and 65000 -- 9000 hike&lt;br /&gt;In this situation many developers tend to use a cursor, determine each       employee's salary and update his salary according to the above formula. But       the same can be achieved by multiple update statements or can be combined       in a single UPDATE statement as shown below:&lt;br /&gt;UPDATE tbl_emp SET salary =&lt;br /&gt;CASE WHEN salary BETWEEN 30000 AND 40000 THEN salary + 5000&lt;br /&gt;WHEN salary BETWEEN 40000 AND 55000 THEN salary + 7000&lt;br /&gt;WHEN salary BETWEEN 55000 AND 65000 THEN salary + 10000&lt;br /&gt;END &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;You need to call a stored procedure when a       column in a particular row meets certain condition. You don't have to use       cursors for this. This can be achieved using WHILE loop, as long as there       is a unique key to identify each row. For examples of using WHILE loop       for row by row processing, check out the 'My code library' section of my       site or search for WHILE. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is Dynamic Cursor? Suppose, I have a dynamic cursor attached      to table in a database.&amp;nbsp; I have another means by which I will modify      the table.&amp;nbsp; What do you think will the values in the cursor be?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Dynamic cursors reflect all      changes made to the rows in their result set when scrolling through the      cursor. The data values, order, and membership of the rows in the result      set can change on each fetch. All UPDATE, INSERT, and DELETE statements      made by all users are visible through the cursor. Updates are visible      immediately if they are made through the cursor using either an API      function such as SQLSetPos or the Transact-SQL WHERE CURRENT OF clause.      Updates made outside the cursor are not visible until they are committed,      unless the cursor transaction isolation level is set to read uncommitted. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is DATEPART?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Returns an integer representing      the specified datepart of the specified date. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Difference between Delete and Truncate?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;TRUNCATE TABLE is      functionally identical to DELETE statement with no WHERE clause: both      remove all rows in the table.&lt;br /&gt;(1) But TRUNCATE TABLE is faster and uses fewer system and transaction log      resources than DELETE. The DELETE statement removes rows &lt;u&gt;one at a time      and records an entry in the transaction log&lt;/u&gt; for each deleted row.      TRUNCATE TABLE removes the data by deallocating the data pages used to      store the table's data, and &lt;u&gt;only the page deallocations&lt;/u&gt; are      recorded in the transaction log.&lt;br /&gt;(2) Because TRUNCATE TABLE is not logged, it &lt;u&gt;cannot activate a trigger&lt;/u&gt;.&lt;br /&gt;(3) The &lt;u&gt;counter&lt;/u&gt; used by an identity for new rows is &lt;u&gt;reset&lt;/u&gt; to      the seed for the column. If you want to retain the identity counter, use      DELETE instead.&lt;br /&gt;Of course, TRUNCATE TABLE can be rolled back. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Given a scenario where two operations, Delete Stmt and Truncate      Stmt, where the Delete Statement was successful and the truncate stmt was      failed. – Can u judge why?&lt;br /&gt;**&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are global variables? Tell me some of them?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Transact-SQL global variables      are a form of function and are now referred to as functions.&lt;br /&gt;ABS - Returns the absolute, positive value of the given numeric      expression.&lt;br /&gt;SUM&lt;br /&gt;AVG&lt;br /&gt;AND &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is DDL?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Data definition language      (DDL) statements are SQL statements that support the definition or      declaration of database objects (for example, CREATE TABLE, DROP TABLE,      and ALTER TABLE).&lt;br /&gt;You can use the ADO Command object to issue DDL statements. To      differentiate DDL statements from a table or stored procedure name, set      the CommandType property of the Command object to adCmdText. Because      executing DDL queries with this method does not generate any recordsets,      there is no need for a Recordset object. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is DML?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Data Manipulation Language      (DML), which is used to select, insert, update, and delete data in the      objects defined using DDL &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are keys in RDBMS? What is a primary key/ foreign key?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;There are two kinds of keys.&lt;br /&gt;A primary key is a set of columns from a table that are guaranteed to have      unique values for each row of that table.&lt;br /&gt;Foreign keys are attributes of one table that have matching values in a &lt;b&gt;primary      key&lt;/b&gt; in another table, allowing for relationships between tables. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is the difference between Primary Key and Unique Key?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Both primary key and unique      key enforce uniqueness of the column on which they are defined. But by      default primary key creates a &lt;u&gt;clustered index&lt;/u&gt; on the column, where      are unique creates a &lt;u&gt;nonclustered index by default&lt;/u&gt;. Another major      difference is that, primary key &lt;u&gt;doesn't allow NULLs&lt;/u&gt;, but unique key      &lt;u&gt;allows one NULL&lt;/u&gt; only. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Define candidate key, alternate key, composite key?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;A &lt;u&gt;candidate key is one that can identify each row of a table uniquely&lt;/u&gt;.      Generally a candidate key becomes the primary key of the table. If the      table has more than one candidate key, one of them will become the primary      key, and the rest are called alternate keys. &lt;br /&gt;A key formed by combining at least two or more columns is called composite      key. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is the Referential Integrity?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Referential integrity refers      to the consistency that must be maintained between primary and foreign      keys, i.e. every foreign key value must have a corresponding primary key      value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What are defaults? Is there a column to which a default can't be      bound?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;A default is a value that will be used by a column, if no value is      supplied to that column while inserting data. IDENTITY columns and      timestamp columns can't have defaults bound to them. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is Query optimization? How is tuning a performance of query      done? &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is the use of trace utility?&lt;br /&gt;**&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is the use of shell commands? xp_cmdshell&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Executes a given command      string as an operating-system command shell and returns any output as rows      of text. Grants nonadministrative users permissions to execute &lt;b&gt;xp_cmdshell&lt;/b&gt;.      &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is use of shrink database?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Microsoft® SQL Server 2000      allows &lt;u&gt;each file within a database to be shrunk to remove unused pages&lt;/u&gt;.      Both data and transaction log files can be shrunk. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;If the performance of the query suddenly decreased where you will      check?&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is a pass-through query?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;Microsoft® SQL Server 2000      sends pass-through queries as un-interpreted query strings to an OLE DB      data source. The query must be in a syntax the OLE DB data source will      accept. A Transact-SQL statement uses the results from a pass-through      query as though it is a regular table reference.&lt;br /&gt;This example uses a pass-through query to retrieve a result set from a      Microsoft Access version of the Northwind sample database.&lt;br /&gt;SELECT *&lt;br /&gt;FROM OpenRowset('Microsoft.Jet.OLEDB.4.0', &lt;br /&gt;'c:\northwind.mdb';'admin'; '', &lt;br /&gt;'SELECT CustomerID, CompanyName&lt;br /&gt;FROM Customers&lt;br /&gt;WHERE Region = ''WA'' ') &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How do you differentiate Local and Global Temporary table?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;You can create local and      global temporary tables. Local temporary tables are visible only in the      current session; global temporary tables are visible to all sessions.      Prefix local temporary table names with single number sign (#&lt;i&gt;table_name&lt;/i&gt;),      and prefix global temporary table names with a double number sign (##&lt;i&gt;table_name&lt;/i&gt;).      SQL statements reference the temporary table using the value specified for      &lt;i&gt;table_name&lt;/i&gt; in the CREATE TABLE statement:&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;CREATE TABLE #MyTempTable (cola      INT PRIMARY KEY)&lt;br /&gt;INSERT INTO #MyTempTable VALUES (1) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How the Exists keyword works in SQL Server?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;code&gt;&lt;span style="font-family: Calibri;"&gt;USE pubs&lt;/span&gt;&lt;/code&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family: Calibri;"&gt;SELECT au_lname, au_fname&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family: Calibri;"&gt;FROM authors&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family: Calibri;"&gt;WHERE exists&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&amp;nbsp; (SELECT *&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&amp;nbsp; FROM publishers&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp;&amp;nbsp; WHERE authors.city = publishers.city)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Calibri;"&gt;When a subquery is introduced      with the keyword EXISTS, it functions as an existence test. The WHERE      clause of the outer query tests for the existence of rows returned by the      subquery. The subquery &lt;u&gt;does not actually produce any data; it returns a      value of TRUE or FALSE&lt;/u&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;ANY?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;USE pubs&lt;br /&gt;SELECT au_lname, au_fname&lt;br /&gt;FROM authors&lt;br /&gt;WHERE city = ANY&lt;br /&gt;(SELECT city&lt;br /&gt;FROM publishers) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;to select date part only&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;SELECT CONVERT(char(10),GetDate(),101)&lt;br /&gt;--to select time part only&lt;br /&gt;SELECT right(GetDate(),7) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;How can I send a message to user from the SQL Server? &lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;You can use the xp_cmdshell      extended stored procedure to run net send command. This is the example to      send the 'Hello' message to JOHN:&lt;br /&gt;EXEC master..xp_cmdshell "net send JOHN 'Hello'"&lt;br /&gt;To get net send message on the Windows 9x machines, you should run the      WinPopup utility. You can place WinPopup in the Startup group under      Program Files. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;What is normalization? Explain different levels of normalization?      Explain Third normalization form with an example?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;The process of refining      tables, keys, columns, and relationships to create an efficient database      is called &lt;i&gt;normalization&lt;/i&gt;. This should eliminates unnecessary      duplication and provides a rapid search path to all necessary information.&lt;br /&gt;Some of the benefits of normalization are: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Data integrity (because there is no       redundant, neglected data) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Optimized queries (because normalized tables       produce rapid, efficient joins) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Faster index creation and sorting (because       the tables have fewer columns) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Faster UPDATE performance (because there are       fewer indexes per table) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Improved concurrency resolution (because       table locks will affect less data) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Eliminate redundancy &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-family: Calibri;"&gt;There are a few rules for database normalization. Each rule is called a "normal form." If the first rule is observed, the database is said to be in "first normal form." If the first three rules are observed, the database is considered to be in "third normal form." Although other levels of normalization are possible, third normal form is considered the highest level necessary for most applications. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;First Normal Form (1NF)&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol start="1" type="1"&gt;&lt;ol start="1" type="1"&gt;&lt;ul type="square"&gt;&lt;li class="MsoNormal"&gt;&lt;u&gt;&lt;span style="font-family: Calibri;"&gt;Eliminate repeating groups&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family: Calibri;"&gt; in individual tables &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Create a &lt;u&gt;separate table for each set of        related data&lt;/u&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Identify each set of related data with a &lt;u&gt;primary        key&lt;/u&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span style="font-family: Calibri;"&gt;Do not use multiple fields in a single table to store similar data. &lt;br /&gt;Example &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 1in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Subordinate1 &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Subordinate2 &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Subordinate3 &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 88.6pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Subordinate4 &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Bob &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jim &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Beth &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.6pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mike &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jason &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Carol &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.6pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mark &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jim &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Alan &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 88.6pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span style="font-family: Calibri;"&gt;Eliminate duplicative columns from the same table.&amp;nbsp; Clearly, the Subordinate1-Subordinate4 columns are duplicative. What happens when we need to add or remove a subordinate? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 1in;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 141.6pt;" width="189"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Subordinates&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Bob &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 141.6pt;" width="189"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jim, Mary, Beth&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 141.6pt;" width="189"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mike, Jason, Carol, Mark   &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 88.55pt;" width="118"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jim &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 141.6pt;" width="189"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Alan&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span style="font-family: Calibri;"&gt;This solution is closer, but it also falls short of the mark. The subordinates column is still duplicative and non-atomic. What happens when we need to add or remove a subordinate? We need to read and write the entire contents of the table. That’s not a big deal in this situation, but what if one manager had one hundred employees? Also, it complicates the process of selecting data from the database in future queries. &lt;br /&gt;Solution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin-left: 1in; width: 151px;"&gt;&lt;tbody&gt;&lt;tr&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: windowtext windowtext windowtext -moz-use-text-color; border-style: solid solid solid none; border-width: 1pt 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Subordinate&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Bob &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jim &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Bob &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Bob &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Beth &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mike &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jason &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Carol &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mary &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Mark &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext; border-style: none solid solid; border-width: medium 1pt 1pt; padding: 0in; width: 60.6pt;" width="81"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Jim &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style="border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-style: none solid solid none; border-width: medium 1pt 1pt medium; padding: 0in; width: 79.8pt;" width="106"&gt;&lt;div class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Alan &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Calibri;"&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-size: 7pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri;"&gt;Second Normal Form (2NF)&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;ol start="1" type="1"&gt;&lt;ol start="2" type="1"&gt;&lt;ul type="square"&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Create &lt;u&gt;separate tables for sets of values        that apply to multiple records.&lt;/u&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Calibri;"&gt;Relate these tables with a&lt;u&gt; foreign key&lt;/u&gt;.        &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span style="font-family: Calibri;"&gt;Records should not depend on anything other than a table's primary key (a compound key, if necessary). &lt;br /&gt;For example, consider a customer's address in an accounting system. The address is needed by the Customers table, but also by the Orders, Shipping, Invoices, Accounts Receivable, and Collections tables. Instead of storing the customer's addres
