Possible Duplicate:
Hidden Features of SQL Server
I believe that this question has incorrectly been closed as an exact duplicate. 19 people have this question favorited so I do not believe this is an incorrect assumption. In the question, I am not asking about hidden features as in the other question, I'm ask about features/commands that most developers should probably know, but are unaware of. Please vote to reopen this question. It is Community Wiki so there is no reason why it should be closed. Thanks
I've worked as a .NET developer for a while now, but predominantly against a SQL Server database for a little over 3 years now. I feel that I have a fairly decent grasp of SQL Server from a development standpoint, but I ashamed to admit that I just learned today about "WITH TIES" from this answer - http://stackoverflow.com/questions/1236394/top-5-with-most-friends/1236414#1236414.
It is humbling to see questions and answers like this on SO because it helps me realize that I really don't know as much as I think I do and helps re-energize my will to learn more, so I figured what better way than to ask the masses of experts for input on other handy commands/features.
What is the most useful feature/command that the average developer is probably unaware of?
BTW - if you are like I was and don't know what "WITH TIES" is for, here is a good explanation. You'll see quickly why I was ashamed I was unaware of it. I could see where it could be useful though. - http://harriyott.com/2007/06/with-ties-sql-server-tip.aspx
I realize that this is a subjective question so please allow for at least a few answers before you close it. :) I'll try to edit my question to keep up a list with your response. Thanks
[EDIT] - Here is a summary of the responses Please scroll down for more information. Thanks again guys/gals.
- MERGE - A single command to INSERT / UPDATE / DELETE into a table from a row source.
- FILESTREAM feature of SQL Server 2008 allows storage of and efficient access to BLOB data using a combination of SQL Server 2008 and the NTFS file system
- CAST - get a date without a time portion
- Group By - I gotta say you should definitely know this already
- SQL Server Management Studio
- Transactions
- The sharing of local scope temp tables between nested procedure calls
- INSERT INTO
- MSDN
- JOINS
- PIVOT and UNPIVOT
- WITH(FORCESEEK) - forces the query optimizer to use only an index seek operation as the access path to the data in the table.
- FOR XML
- COALESCE
- How to shrink the database and log files
- Information_Schema
- SET IMPLICIT_TRANSACTIONS in Management Studio 2005
- Derived tables and common table expressions (CTEs)
- OUTPUT clause - allows access to the "virtual" tables called inserted and deleted (like in triggers)
- CTRL + 0 to insert null
- Spacial Data in SQL Server 2008