SQL SERVER – FIX : Error 3154: The backup set holds a backup of a database other than the existing database

Our Jr. DBA ran to me with this error just a few days ago while restoring the database. Error 3154: The backup set holds a backup of a database other than the existing database. Solution is very simple and not as difficult as he was thinking. He was trying to…
Read More

SQL SERVER – Fix : Error : Msg 3117, Level 16, State 4 The log or differential backup cannot be restored because no files are ready to rollforward

Following error occurs when tried to restored the differential backup. Fix : Error : Msg 3117, Level 16, State 4 The log or differential backup cannot be restored because no files are ready to rollforward Fix/WorkAround/Solution: This error happens when Full back up is not restored before attempting to restore…
Read More

SQL SERVER – 2005 – Use of Non-deterministic Function in UDF – Find Day Difference Between Any Date and Today

While writing few articles about SQL Server DataTime I accidentally wrote User Defined Function (UDF), which I would have not wrote usually. Once I wrote this function, I did not find it very interesting and decided to discard it. However, I suddenly noticed use of Non-Deterministic function in the UDF.…
Read More

SQL SERVER – 2005 – Difference and Similarity Between NEWSEQUENTIALID() and NEWID()

NEWSEQUENTIALID() and NEWID() both generates the GUID of datatype of uniqueidentifier. NEWID() generates the GUID in random order whereas NEWSEQUENTIALID() generates the GUID in sequential order. Let us see example first demonstrating both of the function. USE AdventureWorks; GO ----Create Test Table for with default columns values CREATE TABLE TestTable…
Read More