1. Information about user
There are requirements when user wants to know that who is connected to the SQL Server. The T-SQL provides the stored procedure sp_who. It helps know who all are connected to the to the computer.
The syntax for the stored procedure is as mentioned below:
sp_who...

User needs to create and manage the indexes in SQL Server. There are various types of indexes in SQL server. We shall explore in detail about the indexes in SQL Server.
An index is a structure associated with the SQL Server for implementing the indexes on the tables. It enables faster data...

There are certain conditions when either all the statements are executed successfully or none of them are executed. The data integrity is maintained by the user. The SQL Server helps user to maintain the integrity of data. There are several sources accessing a single resource at a time. To prevent...

In SQL Server, the LIKE operator is used for searching the text value in a particular column. The synonyms and antonyms of the specific word are searched using the full text search. The full text search feature is the default and enabled in SQL Server. In this article, we shall learn about the full...

Several databases are supported by the SQL Server. There are some standard system databases provided by SQL Server. The system database contains some server specific configurations and templates for the database. They have some temporary storage for querying the database.
The list of databases...

The Service Broker helps users for creating services that can be used for sending and receiving messages. Service is used as a database object. It helps user by creating an endpoint for conversation.
The following diagram shows the asynchronous messages to be communicated in Service Broker.
...

It is a markup language that is used for describing the data structure in a hierarchical manner. The data can be saved and retrieved in an XML format in SQL Server. Several database applications are supported.
Storing XML Data in a Table
The data in an XML format can be XML fragments or XML...

User can create the programs supported by the .NET supported languages using the CLR integration with the SQL Server. The managed code can be defined as the code written and supported with any .NET programming language.
Let us take an overview of the details of the CLR integration through SQL...

A trigger is a stored procedure used to execute the statements when an event is raised. The trigger is used statements for actions like insert, delete or update the data. The basics about triggers in sql server is here. In this article we will discuss about several trigger types used for...

To retrieve data from multiple tables, SQL server allows user to apply joins to the tables. Depending on the condition, user can join multiple tables or views. There are different types of join available in SQL Server as inner join, outer join, cross join, equi join, and self join.
Inner Join...

The aggregate functions are used for performing operation on a set of values. The result returned is a single value. The SELECT statement is used along with the function to perform the specific operations. The syntax for the aggregate function is as shown below:
SELECT aggregate_function ( )...

Using String Functions
User can use the string functions for changing the string values in the result set. They can be used with char or varchar data types. They can be used as a part of the expression.
The syntax for using the string function is as shown below:
SELECT function_name...

There are many occasions where if someone updates a records or even deletes a record we need to keep the Audit trails of the record updated or deleted or even keep a history of records as what are the updates that happened on the database as well as what are the records deleted from the table. In...

Introduction
Stored procedures are special objects available in sql server. Its a precompiled statements where all the preliminary parsing operations are performed and the statements are ready for execution.
Its very fast when compared to ordinary sql statements where the sql...

A trigger is a special kind of stored procedure that is invoked whenever an attempt is made to modify the data in the table it protects. Modifications to the table are made ussing INSERT,UPDATE,OR DELETE statements.Triggers are used to enforce data integrity and business rules such as...

Introduction
I had a complex SQL query that was used to extract data from my system and send it across via web request to an external system. The query was taking unduly longer time to run. I made few changes to the query structure and reduced it run time to 7 mins. A part of the main query...

CUBE generates a result set that represents aggregates for all combinations of values in the selected columns. CUBE automatically generates a summation rollup to the top level of a GROUP BY.
Lets us look one Example.
Create table #TempTable(Items varchar(30),
...

SQL Server implements Client/Server technology.A number of client send queries to the Central Server.The server after receiving the query request,parses it for syntax errors and process the request.Since the query passes from the client to the server through the network it adds to network...