SQL Server Joins
SQL Server joins are required to retrieve data from one or more tables to get a single result set. Joins are needed when Normalization enforced in design. When you normalize the data you be reducing redundancy in data by placing data in different tables and also you will be creating relationship between the tables. With the help of these relationship you will be retrieving the data using joins efficiently.
Variable and Assignment enhancements – SQL Server 2008
Variable and assignment enhancements are small plus points in SQL Server 2008. We have around 4 things to discuss under this and they are below. All of these are mostly helpful to developers.
- Declare Statement
- Compound Assignment Operators
- Row Constructors
- Table Valued Parameter (TVP) Lets discuss on this titles one by one
Return Code Values Documentation for sp_send_dbmail procedure
I saw a question on MSDN forums today about return code values documentation for sp_send_dbmail procedure. Microsoft has not documented these return values to the user because when an error exists in the code the user will get a clear description about the error which is easy to understand hence they have provided only description for 0 (failure) and 1 (success). I’ll provide the list of return values and their description here, I’m sharing this since some of the developers will read this value and they can make use of it to get the reason for failure.
FORCESEEK Hint – SQL Server 2008
New article posted on "Forceseek Hint" in SQL Server 2008. Check it out from the link below.
Forceseek hint is a new addition to SQL Server 2008. It forces the query optimizer to use an Index seek instead of Index scan. Forceseek applies to both clustered and nonclustered index seek operations. It can be specified for any table or view in the FROM clause of a SELECT statement and in the FROM clause of an UPDATE or DELETE statement.
MERGE Statement – SQL Server 2008
New article posted on Merge statement for SQL Server 2008. You can check the article from the link below.
In earlier versions of SQL Server in order to perform INSERT, UPDATE or DELETE we have to have separate T-SQL statements. With the introduction of SQL Server 2008 we have MERGE statement which helps in simplifying this. It allows us to perform DML operations based on certain JOIN conditions in single statement.
The Merge statement basically has two tables namely source table and destination table. We have to perform a join between them using a certain condition. If the condition matches certain action is performed in the target table. If the condition doesn’t matches some other action is performed and so on.