Unable to detach SQL database: "The database is in single-user mode, and a user is currently connected to it."

Scenario:   When you attempt to Detach a SQL database, you may possibly end up encountering an error message as below: C:\>SQLCMD.EXE -U sa -P P@ssword -S TESTDBSRV01\APPDB01 -i “C:\Detach-APP-DB.sql”Msg 5064, Level 16, State 1, Server TESTDBSRV01\APPDB01, Line 1Changes to the state or options of database ‘APPDB01’ cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.Msg 5069, Level 16, State 1, Server TESTDBSRV01\APPDB01, Line 1ALTER DATABASE statement failed. C:\> Where in my C:\Detach-APP-DB.sql file contains below statement: ALTER DATABASE HRINDDB01 SET OFFLINE WITH ROLLBACK IMMEDIATE Solution:   To resolve […]

Read more

Quick Fix MSI Uninstall Error "Product Removal failed" with Error Code 1603

Error: During uninstall of certain products you may encounter failures with below error messages in the uninstall logs:  InstallShield 3:14:39: Invoking script function CleanUpPathInstallShield 3:14:39: CallScriptFunctionFromMsiCA() endsInstallShield 3:14:39: Cleaning up temp file C:\Users\admin01\AppData\Local\Temp\{B98BC354-AE61-46AB-964C-BCCE933AB1B9}\ISBEW64.exeInstallShield 3:14:39: Cleaning up temp file C:\Users\admin01\AppData\Local\Temp\{B98BC354-AE61-46AB-964C-BCCE933AB1B9}\ISRT.dllInstallShield 3:14:39: Cleaning up temp file C:\Users\admin01\AppData\Local\Temp\{B98BC354-AE61-46AB-964C-BCCE933AB1B9}\IsConfig.iniInstallShield 3:14:39: Cleaning up temp file C:\Users\admin01\AppData\Local\Temp\{B98BC354-AE61-46AB-964C-BCCE933AB1B9}\String1033.txtInstallShield 3:14:39: Cleaning up temp file C:\Users\admin01\AppData\Local\Temp\{B98BC354-AE61-46AB-964C-BCCE933AB1B9}\_isres_0x0409.dllInstallShield 3:14:39: Cleaning up temp file C:\Users\admin01\AppData\Local\Temp\{B98BC354-AE61-46AB-964C-BCCE933AB1B9}\setup.inxCustomAction CleanUpPath returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)Action ended 3:14:40: CleanUpPath. Return value 3.Action ended 3:14:40: INSTALL. Return value 3.Property(S): DiskPrompt = [1] Action 3:16:17: MZPInProgressClear. Action […]

Read more

Excel Formula to calculate Number Of Days in a Month

Requirements: You want to build a calculator sheet that requires you to input number of days in a given month. Solution: Excel doesn’t have any built-in function to return the number of days in a month.  I’ve learned below two formulas that does the job. Both of them requires a date input and will return the number of days in the month that date belongs to. Hopefully this may come handy for you. =DAY(EOMONTH(B5,0)) =DAY(DATE(YEAR(B5),MONTH(B5)+1,1)-1)   A Sample table to display number of days in all months of this year 2016.   References: Number-of-Days-Calculator: Days-Calculator.xlsx          

Read more