Though I have written more than 2300 blog posts, I always find things which I have not covered earlier in this blog post. Recently I was asked if I have written a function which rounds up or down the time based on the minute interval passed to it. Well, not earlier, but it is here today about how to create a function to round up time to nearest minute interval.
SQL SERVER – Copy Data from One Table to Another Table – SQL in Sixty Seconds #031 – Video
Copy data from one table to another table is one of the most requested questions on forums, Facebook and Twitter. The question has come in many formats and there are places I have seen developers are using cursor instead of this direct method. Earlier I have written the similar article…
Read MoreSQL SERVER – UNION ALL and ORDER BY – How to Order Table Separately While Using UNION ALL
I often see developers trying following syntax while using ORDER BY. SELECT Columns FROM TABLE1 ORDER BY Columns UNION ALL SELECT Columns FROM TABLE2 ORDER BY Columns However the above query will return following error. Msg 156, Level 15, State 1, Line 5 Incorrect syntax near the keyword ‘ORDER’. It is not…
Read MoreSQLAuthority News – Windows Efficiency Tricks and Tips – Personal Technology Tip
This is the second post in my series about my favorite Technology Tips, and I wanted to focus on my favorite Microsoft product. Choosing just one topic to cover was too hard, though. There are so many interesting things I have to share that I am forced to turn this…
Read MoreSQL SERVER – Move Database Files MDF and LDF to Another Location
When a novice DBA or Developer create a database they use SQL Server Management Studio to create new database. Additionally, the T-SQL script to create a database is very easy as well. You can just write CREATE DATABASE DatabaseName and it will create new database for you. The point to remember here is that it will create the database at the default location specified in SQL Server Instance (this default instance, can be changed and we will see that in future blog posts). Now, once the database files goes in production it will start to grow.
SQL SERVER – Storing Variable Values in Temporary Array or Temporary List
SQL Server does not support arrays or a dynamic length storage mechanism like list. Absolutely there are some clever workarounds and few extra-ordinary solutions but everybody can;t come up with such solution. Additionally, sometime the requirements are very simple that doing extraordinary coding is not required. Here is the simple…
Read MoreSQL SERVER – Last Two Days to Get FREE Book – Joes 2 Pros Certification 70-433
Earlier this week we announced that we will be giving away FREE SQL Wait Stats book to everybody who will get SQL Server Joes 2 Pros Combo Kit. We had a fantastic response to the contest. We got an overwhelming response to the offer. We knew there would be a…
Read More


