Selected Tweets of Year 2009!

This is a rather different post than the usual. As the end of year 2009 approaches, I decided to publish a selected number of tweets I did, grouped into different categories.

It was a great experience to communicate with the Community, among other, by using Twitter. Throughout tweeting it was possible to easily and directly publish short but useful SQL Server tips, links to articles, links to reviews of SQL Server tools and much more!

I hope you find my tweets useful! 🙂

Further below you can find my tweets grouped into the following categories:

  • T-SQLTips
  • SQL Server Performance Tips
  • Events-Related – Screencasts – Webcasts
  • Blog Announcements
  • Other SQL Server-Related  Tips, Articles and Tools
  • Miscellaneous


  1. [T-SQL Tip] You can find information on foreign key constraints in sys.foreign_keys and sys.foreign_key_columns catalog views
  2. [T-SQL Tip] You can find information on primary keys and unique constraints in sys.key_constraints and sys.indexes catalog views
  3. [T-SQL Tip] The last digit in a DATETIME instance can only be 0, 4 or 7. You can use DATETIME2 for more precision.
  4. [T-SQL Tip] A Best Practice for avoiding deadlocks, is to keep transactions in a single batch
  5. [T-SQL Tip] When you rollback a transaction, some functionalities are not reset (i.e. seed values for identity columns)
  6. [T-SQL Tip] An option for Data Archiving in SQL Server is using the OUTPUT clause –
  7. [T-SQL Tip] SELECT GROUPING(ColumnName): Value ‘1’ indicates an aggregate/summary row, Value ‘0’ indicates a detail row
  8. [T-SQL Tip] If you want all values to be included in an aggregation, make sure you replace NULL values with 0’s using ISNULL(ColumnName,0)
  9. [T-SQL Tip] When using ‘COUNT(ColumnName)’ it returns the number of rows containing data in that column. NULL values are ignored
  10. [T-SQL Tip] Order of operations in a WHERE clause: NOT, AND, OR – When not sure, use parentheses
  11. [T-SQL Tip] To use in the WHERE clause of a query ‘value<>NULL’ you first need to ‘SET ANSI_NULLS OFF’ – By default is set to ON
  12. [T-SQL Tip] SET XACT_ABORT OFF: Only the T-SQL stmt (in some cases) that raised the error is rolled back and the txn continues processing.
  13. [T-SQL Tip] SET XACT_ABORT ON: If a T-SQL statement raises a run-time error, the entire transaction is terminated and rolled back.

[SQL Server Performance Tips]

  1. [MSSQL Perf. Tip] When perf. counters indicate a large number of page splits, consider rebuilding the index and decreasing the fill factor
  2. [MSSQL Perf. Tip] For optimal performance, avoid using functions in the WHERE clause
  3. [MSSQL Perf. Tip] The Query Optimizer cannot use indexes when leading wildcard characters are used in the LIKE clause of a WHERE clause
  4. [MSSQL Perf. Tip] The Query Optimizer cannot use indexes when a NOT operator is used in the WHERE clause of a query
  5. [MSSQL Perf. Tip] Regarding joins – Minimize the number of join clauses. Outer joins are more expensive than inner joins.
  6. [MSSQL Perf. Tip] How to optimize queries: re-write query, add/remove indexes, de-normalize/normalize referenced tables
  7. [MSSQL Perf. Tip] With using “SET STATISTICS TIME ON” you are able to get the execution time in ms for each query execution
  8. A great SQL Server DMV for identifying various bottlenecks and other performance issues – sys.dm_os_wait_stats
  9. [MSSQL Perf. Tip] Want a fast way to check your query’s performance (page reads, etc)? Check out “SET STATISTICS IO” –
  10. With “SET STATISTICS IO” you can also easily check the performance of table scans when experimenting with indexes.
  11. Covered Index: An index that contains all the columns referenced in the query (in any clause)
  12. Nonclustered Index: Its bottom level (B-tree leaf nodes) contains only columns included in its key and pointers to the actual data rows
  13. Clustered Index: Its bottom level (B-tree leaf nodes) contains all the table rows (with all the columns)
  14. [SQL Server Performance Tip] Always use a covered index in the cases you have READ operations that return a large number of rows.
  15. Using a covered index will improve performance a lot for queries that return a large number of rows.
  16. When changing the collation of a col. in a WHERE clause, the col. index won’t be used as the data is sorted based on another collation

[Events-Related – Screencasts – Webcasts]

  1. I have just updated CDNUG’s website with a review and photos of our recent event on VS2010 and Windows Azure! –
  2. New Screencast Available! – “Object Dependencies in SQL Server 2008” –
  3. My Webcast on SQL Server 2008 T-SQL Enhancements Now Publicly Available! –
  4. Summary of the CDNUG special event which took place on June 18th, 2009:
  5. New screencast – Using Inheritance in the ADO .NET Entity Framework:
  6. My first screencast on SQL Server 2008!
  7. Just finished updating CDNUG’s website with last Tuesday’s event. Entity Framework and LINQ to Entities!
  8. Reviews for my two latest Live Webcasts on 24 Hours of PASS and MY-TG SQL Server Community Series:,
  9. [Blog] Introduction to #SQLServer #PowerPivot – MS Momentum 2009 Session Review:
  10. [Blog] CDNUG Event Review – October 27, 2009 – Visual Studio 2010 Beta / Windows Azure Platform –
  11. The review of my session (Sync Framework) on MY-TG SQL Server Community Series now available on my blog –
  12. Finally! The review of my session (18) on 24 Hours of PASS is now available on my blog – – Enjoy!
  13. Published a review on my blog for my session ( of 24 Hours of PASS.

[Blog Announcements]

  1. [Blog] Using the OUTPUT Clause: A simple data archiving example – #in #SQLServer
  2. [Blog] #Microsoft Momentum 2009 –
  3. Blog article on Windows Internal Database –
  4. Posts on my blog about SQL Azure –
  5. Blog post on a way of rebuilding all the indexes of a database in SQL Server –
  6. Blog post on index fragmentation in SQL Server (Tips for all the different versions of SQL Server) –
  7. Blog post on getting basic table index information in SQL Server –
  8. Blog post about Sync Framework – | Blog post about ADO .NET Data Services –
  9. [New blog post]: Using Computed Columns in SQL Server –
  10. [New Blog Post]: Mysore PASS Chapter SQL Server Webcasts Series –
  11. [New blog post]: Accessing SQL Azure Using ADO.NET –
  12. New Blog Post: Using the “GO” Command in SQL Server –
  13. New blog post: New Date-Related Functions in SQL Server 2008 –
  14. New blog post – SQL Server 2008 Collation Alignment with Windows Server 2008:
  15. New blog post – Error converting data type varchar to float:
  16. New blog post – Windows Internal Database (SSEE):
  17. New blog post – How to rebuild all the indexes of a database in SQL Server:
  18. New Blog post – Renaming Windows Logins in SQL Server:
  19. New blog post: Installing 32-bit SQL Server 2005 Reporting Services on a 64-bit machine/Windows OS –
  20. New blog post – “The Entity Framework – Part 2 – Inheritance”:
  21. “The Entity Framework – Part 1 – Introduction” is ready!
  22. Have you ever wondered where are temporary tables stored in SQL Server? –
  23. Comparing DATETIME with DATETIME2 –
  24. Oh well, here it is! – A little tip related to Maintenance Plans in SQL Server 2005!
  25. Date Functions in #SQLServer 2008 –
  26. New blog post – SQL Azure: A First Contact –
  27. Discussion: A DBA or a Database Developer? – Your comments are welcome! –

[Other SQL Server-Related  Tips, Articles and Tools]

  1. Business intelligence made easy: #PowerPivot –
  2. Great article on how to create a #SQLServer Management Studio Add-in –
  3. When you use MS Sync Framework, you do not have to worry about data conflicts; it is efficiently handled! And yes, it’s parameterizable!
  4. A “Local Database Cache” in Visual Studio 2008 SP1, is actually a SQL Server Compact 3.5 database.
  5. The easiest way to build an occasionally connected application in Visual Studio 2008 SP1, is to add a new item called “Local Database Cache”
  6. Microsoft Sync Framework 2.0 CTP2: – Yummy! 🙂
  7. A handy ADO .NET Data Services (v1) cheat sheet:
  8. An interesting tool (on CodePlex)! – SQL Azure Explorer –
  9. Snippet Editor on CodePlex: A great tool! –
  10. Good morning! Very interesting project on codeplex – SQL Azure Migration Wizard –
  11. extremely useful when migrating SQL Server instances:
  12. It’s time to generate a huge amount of sample data for use with my #PowerPivot demos. I will use @RedGate’s SQL Data Generator for this
  13. [Blog Post] Product Review: @redgate’s SQL Object Level Recovery Native –
  14. During today’s session I also used Red Gate’s (@redgate) tool “SQL Prompt 4” (; a great tool!
  15. Using Computed Columns in #SQLServer –
  16. Change Data Capture (CDC): Determines and tracks the data that has changed- How it is implemented in #SQLServer 2008:
  17. GROUPING SETS can be also combined with ROLLUP and CUBE operations. Isn’t this cool? 🙂
  18. GROUPING SETS in #SQLServer 2008 – – In many cases they can even be equivalent to ROLLUP or CUBE operations
  19. [MSSQL DBA Tip] How to shrink the tempdb database in SQL Server –
  20. MSDN BOL on Master Data Services in SQL Server 2008 R2 Nov. CTP –
  21. Always keep in mind the following upgrade scenarios supported in #SQLServer 2008 –
  22. #SQLServer 2008 R2 November CTP available to the general public on November 11th –
  24. need to copy the DB files from an instance to another but I can’t stop the source MSSQL instance. Oh well, I’ll just take the DBs offline!
  25. Useful: Deprecated Database Engine Features in SQL Server 2008 –
  26. So it is preferable to use sp_send_dbmail when needed to send mail from MSSQL Database Engine. For more information:
  27. Comparing xp_sendmail to sp_send_dbmail: They both send mail from SQL Server but the former will be removed in a future version of MSSQL.
  28. [MSSQL Error Handling Tip] ERROR_PROCEDURE –
  29. By the way, it always useful to understand the SQL Server Error Message Severity Levels – It helps for debugging! –
  30. By the way, to get a list of all the schemas in a database you can try this: USE [DatabaseName]; SELECT * FROM sys.schemas;
  31. More on Capitalization Styles –
  32. Naming guidelines for when creating DB tables/columns: use Pascal Casing, avoid abbreviations, use self-explanatory names.
  33. REVOKE just “cancels” any previously given permissions (including DENY).
  34. Do not get confused with DENY and REVOKE. DENY is a permission which just denies access to a securable (i.e. a database table).
  35. When you are using the REVOKE statement in SQL Server, you can either use the clause TO or FROM for specifying the grantee principal
  36. How to transfer logins and passwords between instances of SQL Server: – Actually I am just doing this!
  37. Just got the error message: Unable to load DLL ‘sqlceme35.dll’ – To fix it just (re)install SQL Server CE 3.5 SP1! –
  38. How to identify your SQL Server version and edition:
  39. SQL Server 2008 R2 – Application and Multi-Server Management –
  40. What’s New in SQL Server 2008 R2 November CTP –
  41. A great article on @mssqltips website; Scheduling a SQL Server Profiler Trace –


  1. Want to convert Live Meeting wmv successfully? Use Windows Media Encoder! It’s great! –
  2. Differences between Windows XP Mode and MED-V:
  3. Windows 7 Learning Portal:

More tweets about SQL Server to come in 2010!