Clustered vs non clustered index


from http://www.programmerinterview.com/index.php/database-sql/clustered-vs-non-clustered-index/

What is the difference between a Clustered and Non Clustered Index?

A clustered index determines the order in which the rows of a table are stored on disk. If a table has a clustered index, then the rows of that table will be stored on disk in the same exact order as the clustered index. An example will help clarify what we mean by that.

An example of a clustered index

Continue reading

Advertisements

Only one clustered index can be created on table


A clustered index sorts and stores the data rows in the table based on the index key values. Therefore only one clustered index can be created on each table because the data rows themselves can only be sorted in one order.

To create a different clustered index on the same table, change the Create as Clustered property setting on the existing clustered index before creating the second index.

For all your application development needs, visit www.verbat.com for a fiscally conscious proposal that meets your needs ( So I can keep this blog going as well!!!!)

Alternatively click through the link   if you found this article interesting. (This will help the companies Search engine rankings)

Table Variables


http://odetocode.com/articles/365.aspx

Microsoft introduced table variables with SQL Server 2000 as an alternative to using temporary tables. In many cases a table variable can outperform a solution using a temporary table, although we will need to review the strengths and weaknesses of each in this article.Table variables store a set of records, so naturally the declaration syntax looks very similar to a CREATE TABLE statement, as you can see in the following example:

Continue reading

Performance tuning of SQL Queries (Oracle)


Contents copied from http://geekexplains.blogspot.com/2008/06/how-to-tune-sql-queries-for-better.html

Performance of the SQL queries of an application often play a big role in the overall performance of the underlying application. The response time may at times be really irritating for the end users if the application doesn’t have fine-tuned SQL queries. There are sevaral ways of tuning SQl statements, few of which are:-

Continue reading

ASP.net Interview questions


Q) In what order do the events of an ASPX page execute. As a developer is it important to undertsand these events?  INIT, PageLoad, Prerender , UNload.

Q) In which event are the controls fully loaded?  Page load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but you will see that view state is not fully loaded during this event

Q) What is AutoPostBack?  If you want a control to postback automatically when an event is raised, you need to set the AutoPostBackproperty of the control to True.

Q) Suppose you want an ASP.NET function (client side) executed on the MouseOver event of a button. Where do you add an event handler?  The event handler is added to the Add() method of the Attributes property.

Q) How can you implement the postback property of an ASP.NET control?  You need to set the AutoPostBack property to True to implement the PostBack property of controls.

Q) What are the event handlers that can be included in the Global.asax file?  The Global.asax file contains some of the following important event handlers:

  • Application_Error
  • Application_Start
  • Application_End
  • Session_Start
  • Session_End

Q) When we execute a Web page, it passes from the following stages, which are collectively known as Web page lifecycle:

Ans:

  • Page request – During this stage, ASP.NET makes sure the page either parsed or compiled and a cached version of the page can be sent in response
  • Start – During this stage sets the Request and Response page properties and the page check the page request is either a postback or a new request
  • Page Initialization – During this stage, the page initialize and the control’s Unique Id property are set
  • Load – During this stage, if the request is postback, the control properties are loaded without loading the view state and control state otherwise loads the view state
  • Validation – During this stage, the controls are validated
  • Postback event handling – During this stage, if the request is a postback, handles the event
  • Rendering – During this stage, the page invokes the Render method to each control for return the output
  • Unload – During this stage, when the page is completely rendered and sent to the client, the page is unloaded.

What’s the use of Response.Output.Write()? We can write formatted output  using Response.Output.Write().

List the events in page life cycle.
  1) Page_PreInit
2) Page_Init
3) Page_InitComplete
4) Page_PreLoad
5) Page_Load
6) Page_LoadComplete
7) Page_PreRender
8)Render
Differentiate strong typing and weak typing
In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime.
List all templates of the Repeater control.
  • ItemTemplate
  • AlternatingltemTemplate
  • SeparatorTemplate
  • HeaderTemplate
  • FooterTemplate
What are the components of ADO.NET?
The components of ADO.Net are Dataset, Data Reader, Data Adaptor, Command, connection.

What is the difference between ExecuteScalar and ExecuteNonQuery?

ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.