Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

What Is Strong-typing Versus Weak-typing? Which Is Preferred? Why?

Answer»

Strong typing implies that the types of VARIABLES INVOLVED in OPERATIONS are associated to the VARIABLE, checked at compile-time, and require explicit conversion; weak typing implies that they are associated to the value, checked at run-time, and are implicitly CONVERTED as required. (Which is preferred is a disputable point.

Strong typing implies that the types of variables involved in operations are associated to the variable, checked at compile-time, and require explicit conversion; weak typing implies that they are associated to the value, checked at run-time, and are implicitly converted as required. (Which is preferred is a disputable point.

2.

What Is The Difference Between An Exe And A Dll?

Answer»

You can CREATE an objects of Dll but not of the EXE.

Dll is an In-Process Component whereas EXE is an OUt-Process Component.

Exe is for SINGLE USE whereas you can use Dll for MULTIPLE use.

Exe can be started as STANDALONE where dll cannot be.

You can create an objects of Dll but not of the EXE.

Dll is an In-Process Component whereas EXE is an OUt-Process Component.

Exe is for single use whereas you can use Dll for multiple use.

Exe can be started as standalone where dll cannot be.

3.

Describe The Difference Between A Thread And A Process?

Answer»

A Process is an instance of an running application. And a THREAD is the Execution stream of the Process. A process can have multiple Thread.

When a process starts a SPECIFIC memory AREA is allocated to it. When there is multiple thread in a process, each thread gets a memory for storing the variables in it and plus they can access to the GLOBAL variables which is common for all the thread.

Eg. A Microsoft Word is a Application. When you OPEN a word file, an instance of the Word starts and a process is allocated to this instance which has one thread.

A Process is an instance of an running application. And a thread is the Execution stream of the Process. A process can have multiple Thread.

When a process starts a specific memory area is allocated to it. When there is multiple thread in a process, each thread gets a memory for storing the variables in it and plus they can access to the global variables which is common for all the thread.

Eg. A Microsoft Word is a Application. When you open a word file, an instance of the Word starts and a process is allocated to this instance which has one thread.

4.

What Happens In Memory When You Box And Unbox A Value-type?

Answer»

BOXING CONVERTS a VALUE-type to a reference-type, thus storing the OBJECT on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

5.

How Do You Convert A Value-type To A Reference-type?

Answer»

USE BOXING.

Use Boxing.

6.

When Should You Call The Garbage Collector In .net?

Answer»

As a good RULE, you should not call the garbage COLLECTOR. However, you could call the garbage collector when you are done using a large OBJECT (or set of OBJECTS) to FORCE the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.

As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice.

7.

What Is The Smallest Unit Of Execution In .net?

Answer»

An ASSEMBLY.

An Assembly.

8.

What Namespaces Are Necessary To Create A Localized Application?

Answer»
  • System.Globalization and,
  • System.Resources.

9.

What Is A Satellite Assembly?

Answer»

When you write a MULTILINGUAL or multi-cultural APPLICATION in .NET, and want to distribute the core application SEPARATELY from the LOCALIZED modules, the localized assemblies that modify the core application are called satellite assemblies.

When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.

10.

What Are The Ways To Deploy An Assembly?

Answer»

11.

How Is The Dll Hell Problem Solved In .net?

Answer»

Assembly versioning allows the application to SPECIFY not only the LIBRARY it needs to run (which was available under Win32), but ALSO the version of the assembly.

Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

12.

What Is Difference Between Webconfig.xml & Machineconfig.xml?

Answer»

Web.config & machine.config both are configuration files.Web.config contains settings SPECIFIC to an application where as machine.config contains settings to a computer. The Configuration system FIRST SEARCHES settings in machine.config file & then looks in application configuration files.Web.config, can appear in multiple directories on an ASP.NET Web application SERVER. Each Web.config file applies configuration settings to its own directory and all child directories below it. There is only Machine.config file on a web server.

Web.config & machine.config both are configuration files.Web.config contains settings specific to an application where as machine.config contains settings to a computer. The Configuration system first searches settings in machine.config file & then looks in application configuration files.Web.config, can appear in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories below it. There is only Machine.config file on a web server.

13.

Describe The Role Of Inetinfo.exe, Aspnet_isapi.dll And Aspnet_wp.exe In The Page Loading Process ?

Answer»

inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests AMONG other things. When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll TAKES care of it by passing the request to the ACTUAL WORKER process aspnet_wp.exe.

inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things. When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe.

14.

What Are The Different Types Of Assemblies Available And Their Purpose?

Answer»

Private, Public/shared and Satellite Assemblies.

Private Assemblies : Assembly used WITHIN an application is known as private assemblies.

Public/shared Assemblies : Assembly which can be shared across applicaiton is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly CACHE).

Satellite Assemblies : These assemblies CONTAIN RESOURCE files PERTAINING to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages.

Private, Public/shared and Satellite Assemblies.

Private Assemblies : Assembly used within an application is known as private assemblies.

Public/shared Assemblies : Assembly which can be shared across applicaiton is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly Cache).

Satellite Assemblies : These assemblies contain resource files pertaining to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages.

15.

What Is The Sequence Of Operation Takes Place When A Page Is Loaded?

Answer»
  • BeginTranaction - only if the REQUEST is transacted,
  • Init - every time a PAGE is PROCESSED,
  • LoadViewState - Only on postback,
  • ProcessPostData1 - Only on postback,
  • Load - every time,
  • ProcessData2 - Only on Postback,
  • RaiseChangedEvent - Only on Postback,
  • RaisePostBackEvent - Only on Postback,
  • PreRender - everytime,
  • BuildTraceTree - only if tracing is ENABLED,
  • SaveViewState - every time,
  • Render - Everytime,
  • End Transaction - only if the request is transacted,
  • Trace.EndRequest - only when tracing is enabled,
  • UnloadRecursive - Every request.

16.

What Is Boxing And Unboxing?

Answer»

BOXING is implicit CONVERSION of ValueTypes to Reference TYPES (Object). UnBoxing is explicit conversion of Reference Types (Object) to its equivalent ValueTypes. It REQUIRES type-casting.

Boxing is implicit conversion of ValueTypes to Reference Types (Object). UnBoxing is explicit conversion of Reference Types (Object) to its equivalent ValueTypes. It requires type-casting.

17.

Describe The Advantages Of Writing A Managed Code Application Instead Of Unmanaged One. What's Involved In Certain Piece Of Code Being Managed?

Answer»

"Advantages includes automatic garbage collection, memory management, security, type checking, versioning.

Managed code is compiled for the .NET run-time environment. It RUNS in the COMMON Language Runtime (CLR), which is the heart of the .NET Framework. The CLR provides SERVICES such as security, memory management, and cross-language integration. Managed applications written to take advantage of the features of the CLR perform more efficiently and safely, and take BETTER advantage of developers existing expertise in languages that support the .NET Framework.

Unmanaged code includes all code written before the .NET Framework was introduced—this includes code written to use COM, native Win32, and Visual Basic 6. Because it does not run inside the .NET environment, unmanaged code cannot MAKE use of any .NET managed facilities."

"Advantages includes automatic garbage collection, memory management, security, type checking, versioning.

Managed code is compiled for the .NET run-time environment. It runs in the Common Language Runtime (CLR), which is the heart of the .NET Framework. The CLR provides services such as security, memory management, and cross-language integration. Managed applications written to take advantage of the features of the CLR perform more efficiently and safely, and take better advantage of developers existing expertise in languages that support the .NET Framework.

Unmanaged code includes all code written before the .NET Framework was introduced—this includes code written to use COM, native Win32, and Visual Basic 6. Because it does not run inside the .NET environment, unmanaged code cannot make use of any .NET managed facilities."

18.

What Is Managed And Unmanaged Code?

Answer»

The .NET framework provides several core run-time services to the programs that run within it - for example exception handling and security. For these services to WORK, the code must provide a minimum level of information to the runtime. i.e., code EXECUTING under the control of the CLR is CALLED managed code. For example, any code written in C# or Visual Basic .NET is managed code. Code that runs outside the CLR is referred to as "unmanaged code." COM components, ActiveX components, and Win32 API functions are examples of unmanaged code.

The .NET framework provides several core run-time services to the programs that run within it - for example exception handling and security. For these services to work, the code must provide a minimum level of information to the runtime. i.e., code executing under the control of the CLR is called managed code. For example, any code written in C# or Visual Basic .NET is managed code. Code that runs outside the CLR is referred to as "unmanaged code." COM components, ActiveX components, and Win32 API functions are examples of unmanaged code.

19.

How To Set The Debug Mode?

Answer»

Debug Mode for ASP.NET applications - To SET ASP.NET APPPLICATION in debugging mode, EDIT the application's web.config and assign the "debug" attribute in < compilation > section to "true" as show below:

< configuration >
< system.web >
< compilation defaultLanguage="vb" debug="true" / >
....
...
..
< / configuration >

This case-sensitive attribute debug tells ASP.NET to generate symbols for dynamically generated files and enables the debugger to attach to the ASP.NET application. ASP.NET will detect this change automatically, WITHOUT the need to restart the server. Debug Mode for ASP.NET WEBSERVICES - Debugging an XML Web service created with ASP.NET is similar to the debugging an ASP.NET Web application.

Debug Mode for ASP.NET applications - To set ASP.NET appplication in debugging mode, edit the application's web.config and assign the "debug" attribute in < compilation > section to "true" as show below:

< configuration >
< system.web >
< compilation defaultLanguage="vb" debug="true" / >
....
...
..
< / configuration >

This case-sensitive attribute debug tells ASP.NET to generate symbols for dynamically generated files and enables the debugger to attach to the ASP.NET application. ASP.NET will detect this change automatically, without the need to restart the server. Debug Mode for ASP.NET Webservices - Debugging an XML Web service created with ASP.NET is similar to the debugging an ASP.NET Web application.

20.

Changes To Which Portion Of Version Number Indicates An Incompatible Change?

Answer»

Major or minor. Changes to the major or minor portion of the version number indicate an incompatible change. Under this convention then, version 2.0.0.0 would be CONSIDERED incompatible with version 1.0.0.0. Examples of an incompatible change would be a change to the types of some method parameters or the removal of a type or method altogether. Build. The Build number is typically used to distinguish between daily BUILDS or smaller compatible releases. REVISION. Changes to the revision number are typically reserved for an INCREMENTAL build needed to fix a particular bug. You'll sometimes hear this referred to as the "emergency bug fix" number in that the revision is what is OFTEN changed when a fix to a specific bug is shipped to a customer.

Major or minor. Changes to the major or minor portion of the version number indicate an incompatible change. Under this convention then, version 2.0.0.0 would be considered incompatible with version 1.0.0.0. Examples of an incompatible change would be a change to the types of some method parameters or the removal of a type or method altogether. Build. The Build number is typically used to distinguish between daily builds or smaller compatible releases. Revision. Changes to the revision number are typically reserved for an incremental build needed to fix a particular bug. You'll sometimes hear this referred to as the "emergency bug fix" number in that the revision is what is often changed when a fix to a specific bug is shipped to a customer.

21.

What Is Partial Assembly References?

Answer»

Full Assembly reference: A full assembly reference INCLUDES the assembly's text name, version, CULTURE, and PUBLIC KEY token (if the assembly has a strong name). A full assembly reference is required if you reference any assembly that is part of the common language RUNTIME or any assembly located in the global assembly cache.

Full Assembly reference: A full assembly reference includes the assembly's text name, version, culture, and public key token (if the assembly has a strong name). A full assembly reference is required if you reference any assembly that is part of the common language runtime or any assembly located in the global assembly cache.

22.

What Is The Difference Between Finalize And Dispose (garbage Collection) ?

Answer»

Class instances often encapsulate control over resources that are not managed by the runtime, such as window handles (HWND), DATABASE connections, and so on. Therefore, you should provide both an explicit and an implicit way to free those resources. Provide implicit control by implementing the protected Finalize Method on an OBJECT (destructor syntax in C# and the Managed Extensions for C++). The garbage collector calls this method at some point after there are no longer any VALID references to the object. In some cases, you might want to provide programmers using an object with the ABILITY to explicitly RELEASE these external resources before the garbage collector frees the object. If an external resource is scarce or expensive, better performance can be achieved if the programmer explicitly releases resources when they are no longer being used. To provide explicit control, implement the Dispose method provided by the IDisposable Interface. The consumer of the object should call this method when it is done using the object.

Dispose can be called even if other references to the object are alive. Note that even when you provide explicit control by way of Dispose, you should provide implicit cleanup using the Finalize method. Finalize provides a backup to prevent resources from permanently leaking if the programmer fails to call Dispose.

Class instances often encapsulate control over resources that are not managed by the runtime, such as window handles (HWND), database connections, and so on. Therefore, you should provide both an explicit and an implicit way to free those resources. Provide implicit control by implementing the protected Finalize Method on an object (destructor syntax in C# and the Managed Extensions for C++). The garbage collector calls this method at some point after there are no longer any valid references to the object. In some cases, you might want to provide programmers using an object with the ability to explicitly release these external resources before the garbage collector frees the object. If an external resource is scarce or expensive, better performance can be achieved if the programmer explicitly releases resources when they are no longer being used. To provide explicit control, implement the Dispose method provided by the IDisposable Interface. The consumer of the object should call this method when it is done using the object.

Dispose can be called even if other references to the object are alive. Note that even when you provide explicit control by way of Dispose, you should provide implicit cleanup using the Finalize method. Finalize provides a backup to prevent resources from permanently leaking if the programmer fails to call Dispose.

23.

What Does 'managed' Mean In The .net Context?

Answer»

Managed code: The .NET framework provides several core run-time services to the programs that run within it - for example exception HANDLING and security. For these services to work, the code must provide a minimum level of INFORMATION to the RUNTIME.

Such code is called managed code. All C# and Visual Basic.NET code is managed by default. VS7 C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/com+).

Managed data: This is data that is allocated and de-allocated by the .NET runtime's garbage collector. C# and VB.NET data is always managed. VS7 C++ data is unmanaged by default, even when USING the /com+ switch, but it can be marked as managed using the __gc keyword.

Managed classes: This is usually referred to in the context of Managed Extensions (ME) for C++. When using ME C++, a class can be marked with the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector, but it also means more than that. The class becomes a fully paid-up member of the .NET community with the benefits and restrictions that brings. An example of a benefit is proper interop with classes written in other languages - for example, a managed C++ class can inherit from a VB class. An example of a restriction is that a managed class can only inherit from one base class.

Managed code: The .NET framework provides several core run-time services to the programs that run within it - for example exception handling and security. For these services to work, the code must provide a minimum level of information to the runtime.

Such code is called managed code. All C# and Visual Basic.NET code is managed by default. VS7 C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/com+).

Managed data: This is data that is allocated and de-allocated by the .NET runtime's garbage collector. C# and VB.NET data is always managed. VS7 C++ data is unmanaged by default, even when using the /com+ switch, but it can be marked as managed using the __gc keyword.

Managed classes: This is usually referred to in the context of Managed Extensions (ME) for C++. When using ME C++, a class can be marked with the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector, but it also means more than that. The class becomes a fully paid-up member of the .NET community with the benefits and restrictions that brings. An example of a benefit is proper interop with classes written in other languages - for example, a managed C++ class can inherit from a VB class. An example of a restriction is that a managed class can only inherit from one base class.

24.

What Is Il?

Answer»

ALSO known as MSIL (Microsoft Intermediate Language) or CIL (Common INTER mediate Language). All .NET SOURCE code (of any language) is compiled to IL. The IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) COMPILER.

Also known as MSIL (Microsoft Intermediate Language) or CIL (Common Inter mediate Language). All .NET source code (of any language) is compiled to IL. The IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.

25.

What Is The Cls?

Answer»

This is a subset of the CTS which all .NET languages are EXPECTED to support. The idea is that any program which uses CLS-compliant types can interoperate with any .NET program written in any LANGUAGE.

 

This is a subset of the CTS which all .NET languages are expected to support. The idea is that any program which uses CLS-compliant types can interoperate with any .NET program written in any language.

 

26.

What Is The Cts?

Answer»

This is the range of TYPES that the .NET runtime understands, and therefore that .NET APPLICATIONS can use. However note that not all .NET LANGUAGES will support all the types in the CTS. The CTS is a superset of the CLS.

This is the range of types that the .NET runtime understands, and therefore that .NET applications can use. However note that not all .NET languages will support all the types in the CTS. The CTS is a superset of the CLS.

27.

What Is The Clr?

Answer»

The CLR is a set of standard RESOURCES that (in theory) any .NET program can take advantage of, regardless of programming language. Many .NET framework classes Development, DEBUGGING, and profiling tools Execution and code management IL-to-native translators and optimizers What this means is that in the .NET world, different programming LANGUAGES will be more equal in CAPABILITY than they have ever been before, although clearly not all languages will support all CLR services.

The CLR is a set of standard resources that (in theory) any .NET program can take advantage of, regardless of programming language. Many .NET framework classes Development, debugging, and profiling tools Execution and code management IL-to-native translators and optimizers What this means is that in the .NET world, different programming languages will be more equal in capability than they have ever been before, although clearly not all languages will support all CLR services.

28.

What Is Linq?

Answer»

Language Integrated Query (LINQ) adds the ability to query OBJECTS using .NET languages. The LINQ to SQL object/relational mapping (O/RM) framework provides the following basic features:

  • Tools to create classes (usually called entities) mapped to DATABASE tables
  • Compatibility with LINQ’s standard query operations
  • The DataContext class, with features such as ENTITY record monitoring, automatic SQL statement generation, record concurrency detection, and much more.

Language Integrated Query (LINQ) adds the ability to query objects using .NET languages. The LINQ to SQL object/relational mapping (O/RM) framework provides the following basic features:

29.

What Are Synonyms?

Answer»

Synonyms give you the ability to provide alternate NAMES for database OBJECTS. You can ALIAS object names; for example, using the EMPLOYEE table as Emp. You can also shorten names. This is especially useful when DEALING with three and four part names; for example, shortening server.database.owner.object to object.

Synonyms give you the ability to provide alternate names for database objects. You can alias object names; for example, using the Employee table as Emp. You can also shorten names. This is especially useful when dealing with three and four part names; for example, shortening server.database.owner.object to object.

30.

What Is Clr?

Answer»

In SQL Server 2008, SQL Server objects such as user‐defined functions can be created using such CLR languages. This CLR language SUPPORT extends not only to user‐defined functions, but ALSO to stored procedures and triggers. You can DEVELOP such CLR add‐ons to SQL Server using VISUAL Studio 2008.

In SQL Server 2008, SQL Server objects such as user‐defined functions can be created using such CLR languages. This CLR language support extends not only to user‐defined functions, but also to stored procedures and triggers. You can develop such CLR add‐ons to SQL Server using Visual Studio 2008.

31.

How Can We Rewrite Sub-queries Into Simple Select Statements Or With Joins?

Answer»

we can write using Common Table Expression (CTE). A Common Table Expression (CTE) is an expression that can be thought of as a temporary result set which is defined within the execution of a single SQL statemnt. A CTE is similar to a DERIVED table in that it is not stored as an object and LASTS only for the duration of the query.

E.g.

USE AdventureWorks GO WITH EmployeeDepartment_CTE AS(SELECT EmployeeID,DepartmentID, ShiftID FROM HUMANRESOURCES.Employee Department History) SELECT ECTE.EmployeeId, ED.Department ID, ed.Name, ecte.ShiftID FROM HumanResources. Department ed INNER JOIN EmployeeDepartment_CTE ecte ON ecte. Department ID = ed.Department ID GO

we can write using Common Table Expression (CTE). A Common Table Expression (CTE) is an expression that can be thought of as a temporary result set which is defined within the execution of a single SQL statemnt. A CTE is similar to a derived table in that it is not stored as an object and lasts only for the duration of the query.

E.g.

32.

What Are The Advantages Of Using Cte?

Answer»
  • Using CTE improves the readability and MAKES maintenance of complex queries easy.
  • The QUERY can be divided into separate, simple, logical building blocks which can be then used to build more complex CTE's until FINAL RESULT set is generated.
  • CTE can be defined in functions, stored procedures, TRIGGERS or even views.
  • After a CTE is defined, it can be used as a Table or a View and can SELECT, INSERT, UPDATE or DELETE Data.

33.

Which Are New Data Types Introduced In Sql Server 2008?

Answer»

The GEOMETRY Type: The GEOMETRY data type is a system .NET common language RUNTIME (CLR) data type in SQL Server. This type represents data in a two‐dimensional Euclidean coordinate system.

The GEOGRAPHY Type: The GEOGRAPHY datatype’s functions are the same as with GEOMETRY. The difference between the two is that when you specify GEOGRAPHY, you are usually specifying POINTS in terms of latitude and longitude.

New Date and Time DATATYPES: SQL Server 2008 introduces four new datatypes related to date and time: DATE, TIME, DATETIMEOFFSET, and DATETIME2.

  • DATE: The new DATE type just stores the date itself. It is based on the Gergorian calendar and handles years from 1 to 9999.
  • TIME: The new TIME (n) type stores time with a range of 00:00:00.0000000 through 23:59:59.9999999. The precision is allowed with this type. TIME supports seconds down to 100 nanoseconds. The n in TIME (n) defines this level of fractional second precision, from 0 to 7 digits of precision.
  • The DATETIMEOFFSET Type: DATETIMEOFFSET (n) is the time‐zone‐aware version of a datetime datatype. The name will appear less odd when you CONSIDER what it really is: a date + a time + a time‐zone offset. The offset is based on how FAR behind or ahead you are from Coordinated Universal Time (UTC) time.
  • The DATETIME2 Type: It is an extension of the datetime type in earlier versions of SQL Server. This new datatype has a date range covering dates from January 1 of year 1 through December 31 of year 9999. This is a definite improvement over the 1753 lower boundary of the datetime datatype.

DATETIME2 not only includes the larger date range, but also has a timestamp and the same fractional precision that TIME type provides.

The GEOMETRY Type: The GEOMETRY data type is a system .NET common language runtime (CLR) data type in SQL Server. This type represents data in a two‐dimensional Euclidean coordinate system.

The GEOGRAPHY Type: The GEOGRAPHY datatype’s functions are the same as with GEOMETRY. The difference between the two is that when you specify GEOGRAPHY, you are usually specifying points in terms of latitude and longitude.

New Date and Time Datatypes: SQL Server 2008 introduces four new datatypes related to date and time: DATE, TIME, DATETIMEOFFSET, and DATETIME2.

DATETIME2 not only includes the larger date range, but also has a timestamp and the same fractional precision that TIME type provides.

34.

What Is Filtered Index?

Answer»

Filtered Index is used to index a portion of rows in a table that MEANS it APPLIES FILTER on INDEX which improves query performnce, REDUCE index maintenance costs, and reduce index storage costs compared with full‐table indexes. When we see an Index created with some where clause then that is actually a FILTERED INDEX.

Filtered Index is used to index a portion of rows in a table that means it applies filter on INDEX which improves query performnce, reduce index maintenance costs, and reduce index storage costs compared with full‐table indexes. When we see an Index created with some where clause then that is actually a FILTERED INDEX.

35.

What Is Merge Statement?

Answer»

MERGE is a new feature that provides an efficient way to perform multiple DML operations. In previous versions of SQL Server, we had to write SEPARATE statements to INSERT, UPDATE, or DELETE data based on CERTAIN conditions, but now, using MERGE statement we can include the logic of such data modifications in one statement that EVEN checks when the data is matched then just update it and when unmatched then insert it. One of the most important advantages of MERGE statement is all the data is read and processed only once.

MERGE is a new feature that provides an efficient way to perform multiple DML operations. In previous versions of SQL Server, we had to write separate statements to INSERT, UPDATE, or DELETE data based on certain conditions, but now, using MERGE statement we can include the logic of such data modifications in one statement that even checks when the data is matched then just update it and when unmatched then insert it. One of the most important advantages of MERGE statement is all the data is read and processed only once.

36.

What Is Cte?

Answer»

CTE is an abbreviation of Common Table EXPRESSION. A Common Table Expression (CTE) is an expression that can be thought of as a temporary result set which is defined within the execution of a single SQL statemnt. A CTE is similar to a DERIVED table in that it is not STORED as an object and LASTS only for the duration of the query.

CTE is an abbreviation of Common Table Expression. A Common Table Expression (CTE) is an expression that can be thought of as a temporary result set which is defined within the execution of a single SQL statemnt. A CTE is similar to a derived table in that it is not stored as an object and lasts only for the duration of the query.

37.

What Does Top Operator Do?

Answer»

The TOP operator is used to SPECIFY the number of rows to be RETURNED by a query. The TOP operator has NEW addition in SQL SERVER 2008 that it accepts variables as well as literal values and can be used with INSERT, UPDATE, and DELETES statements.

The TOP operator is used to specify the number of rows to be returned by a query. The TOP operator has new addition in SQL SERVER 2008 that it accepts variables as well as literal values and can be used with INSERT, UPDATE, and DELETES statements.

38.

What Are Sparse Columns?

Answer»

A sparse column is another tool USED to reduce the amount of PHYSICAL storage used in a database. They are the ordinary columns that have an optimized storage for NULL values. Sparse columns reduce the SPACE requirements for null values at the cost of more overhead to RETRIEVE non-null values.

A sparse column is another tool used to reduce the amount of physical storage used in a database. They are the ordinary columns that have an optimized storage for null values. Sparse columns reduce the space requirements for null values at the cost of more overhead to retrieve non-null values.

39.

What Is Replication And Database Mirroring?

Answer»

Database mirroring can be used with replication to provide availability for the publication database. Database mirroring INVOLVES TWO copies of a single database that typically reside on different computers. At any given time, only one copy of the database is currently available to clients which are known as the principal database. Updates made by clients to the principal database are applied on the other copy of the database, known as the mirror database. Mirroring involves APPLYING the transaction log from every insertion, update, or DELETION made on the principal database ONTO the mirror database.

Database mirroring can be used with replication to provide availability for the publication database. Database mirroring involves two copies of a single database that typically reside on different computers. At any given time, only one copy of the database is currently available to clients which are known as the principal database. Updates made by clients to the principal database are applied on the other copy of the database, known as the mirror database. Mirroring involves applying the transaction log from every insertion, update, or deletion made on the principal database onto the mirror database.

40.

What Is Policy Management?

Answer»

POLICY Management in SQL SERVER 2008 allows you to define and enforce policies for configuring and MANAGING SQL Server across TE ENTERPRISE. Policy‐Based Management is configured in SQL Server Management Studio (SSMS). Navigate to the Object Explorer and expand the Management node and the Policy Management node; you will see the Policies, Conditions, and Facets nodes.

Policy Management in SQL SERVER 2008 allows you to define and enforce policies for configuring and managing SQL Server across te enterprise. Policy‐Based Management is configured in SQL Server Management Studio (SSMS). Navigate to the Object Explorer and expand the Management node and the Policy Management node; you will see the Policies, Conditions, and Facets nodes.

41.

Where Sql Server User Names And Passwords Are Stored In Sql Server?

Answer»

They GET STORED in SYSTEM CATALOG VIEWS sys.server_principles and sys.sql_logins.

They get stored in System Catalog Views sys.server_principles and sys.sql_logins.

42.

What Is Service Broker?

Answer»

Service Broker is a message‐queuing technology in SQL Server that allows DEVELOPERS to integrate SQL Server fully into DISTRIBUTED applications. Service Broker is feature which provides facility to SQL Server to send an asynchronous, transactional message. it allows a database to send a message to another database WITHOUT waiting for the response, so the application will continue to function if the remote database is TEMPORARILY unavailable.

Service Broker is a message‐queuing technology in SQL Server that allows developers to integrate SQL Server fully into distributed applications. Service Broker is feature which provides facility to SQL Server to send an asynchronous, transactional message. it allows a database to send a message to another database without waiting for the response, so the application will continue to function if the remote database is temporarily unavailable.

43.

What Are The Basic Functions For Master, Msdb, Model, Tempdb And Resource Databases?

Answer»

The master database holds information for all databases located on the SQL Server instance and is the glue that holds the engine together. Because SQL Server cannot start WITHOUT a functioning masterdatabase, you must administor this database with care.

The msdb database stores information regarding database backups, SQL Agent information, DTS packages, SQL Server jobs, and some replication information such as for LOG shipping.

The tempdb holds TEMPORARY objects such as global and LOCAL temporary tables and stored procedures.

The model is ESSENTIALLY a template database used in the creation of any new user database created in the instance.

The resoure Database is a read‐only database that contains all the system objects that are included with SQL Server. SQL Server system objects, such as sys.objects, are physically persisted in the Resource database, but they logically appear in the sys schema of every database. The Resource database does not contain user data or user metadata.

The master database holds information for all databases located on the SQL Server instance and is the glue that holds the engine together. Because SQL Server cannot start without a functioning masterdatabase, you must administor this database with care.

The msdb database stores information regarding database backups, SQL Agent information, DTS packages, SQL Server jobs, and some replication information such as for log shipping.

The tempdb holds temporary objects such as global and local temporary tables and stored procedures.

The model is essentially a template database used in the creation of any new user database created in the instance.

The resoure Database is a read‐only database that contains all the system objects that are included with SQL Server. SQL Server system objects, such as sys.objects, are physically persisted in the Resource database, but they logically appear in the sys schema of every database. The Resource database does not contain user data or user metadata.

44.

What Is An Execution Plan? When Would You Use It? How Would You View The Execution Plan?

Answer»

An execution plan is basically a road map that graphically or textually shows the DATA retrieval methods chosen by the SQL Server query optimizer for a stored procedure or ad‐hoc query and is a very useful tool for a developer to understand the performance characteristics of a query or stored procedure since the plan is the one that SQL Server will place in its cache and use to EXECUTE the stored procedure or query. From within Query Analyzer is an option called "Show Execution Plan" (located on the Query drop‐down menu). If this option is turned on it will display query execution plan in SEPARATE window when query is run again.

An execution plan is basically a road map that graphically or textually shows the data retrieval methods chosen by the SQL Server query optimizer for a stored procedure or ad‐hoc query and is a very useful tool for a developer to understand the performance characteristics of a query or stored procedure since the plan is the one that SQL Server will place in its cache and use to execute the stored procedure or query. From within Query Analyzer is an option called "Show Execution Plan" (located on the Query drop‐down menu). If this option is turned on it will display query execution plan in separate window when query is run again.

45.

How To Implement One-to-one, One-to-many And Many-to-many Relationships While Designing Tables?

Answer»

One‐to‐One relationship can be IMPLEMENTED as a single table and rarely as two tables with primary and FOREIGN KEY relationships. One‐to‐Many relationships are implemented by splitting the DATA into two tables with primary key and foreign key relationships.

Many‐to‐Many relationships are implemented USING a junction table with the keys from both the tables forming the composite primary key for the junction table.

One‐to‐One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships. One‐to‐Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships.

Many‐to‐Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key for the junction table.

46.

What Is Bcp? When Does It Used?

Answer»

BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination. BULK INSERT command HELPS to import a data file into a database table or view in a user‐specified FORMAT.

BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination. BULK INSERT command helps to import a data file into a database table or view in a user‐specified format.

47.

Can Sql Servers Linked To Other Servers Like Oracle?

Answer»

SQL Server can be linked to any server provided it has OLE‐DB provider from Microsoft to ALLOW a link. E.g. ORACLE has an OLE‐DB provider for oracle that Microsoft PROVIDES to add it as linked server to SQL Server GROUP.

SQL Server can be linked to any server provided it has OLE‐DB provider from Microsoft to allow a link. E.g. Oracle has an OLE‐DB provider for oracle that Microsoft provides to add it as linked server to SQL Server group.

48.

What Is A Table Called, If It Has Neither Cluster Nor Non-cluster Index? What Is It Used For?

Answer»

Unindexed table or Heap. MICROSOFT Press Books and Book online (BOL) refers it as Heap. A heap is a table that does not have a clustered index and therefore, the pages are not linked by pointers. The IAM pages are the only structures that link the pages in a table together. Unindexed TABLES are good for FAST storing of data. Many times it is better to drop all indexes from table and then do bulk of inserts and to RESTORE those indexes after that.

Unindexed table or Heap. Microsoft Press Books and Book online (BOL) refers it as Heap. A heap is a table that does not have a clustered index and therefore, the pages are not linked by pointers. The IAM pages are the only structures that link the pages in a table together. Unindexed tables are good for fast storing of data. Many times it is better to drop all indexes from table and then do bulk of inserts and to restore those indexes after that.

49.

What Are The Advantages Of Using Stored Procedures?

Answer»
  • Stored procedure can reduced network traffic and latency, boosting application PERFORMANCE.
  • Stored procedure execution plans can be reused, staying cached in SQL Server's memory, reducing server overhead.
  • Stored procedures help promote code reuse.
  • Stored procedures can encapsulate logic. You can change stored procedure code without affecting clients.
  • Stored procedures provide BETTER SECURITY to your DATA.

50.

What Is A Scheduled Jobs Or What Is A Scheduled Tasks?

Answer»

SCHEDULED tasks let user AUTOMATE processes that run on regular or predictable cycles. User can schedule administrative tasks, such as cube processing, to run during times of slow business activity. User can also determine the order in which tasks run by creating job steps within a SQL Server Agent job. E.g. back up database, Update STATUS of Tables. Job steps give user CONTROL over flow of execution. If one job fails, user can configure SQL Server Agent to continue to run the remaining tasks or to stop execution.

Scheduled tasks let user automate processes that run on regular or predictable cycles. User can schedule administrative tasks, such as cube processing, to run during times of slow business activity. User can also determine the order in which tasks run by creating job steps within a SQL Server Agent job. E.g. back up database, Update Status of Tables. Job steps give user control over flow of execution. If one job fails, user can configure SQL Server Agent to continue to run the remaining tasks or to stop execution.