DECLARE @LastmonLastBusinessDay date, @inputdate date SET @inputdate = ’05/25/2014′ SELECT @LastmonLastBusinessDay = DATEADD(ms,-3,DATEADD(mm,DATEDIFF(mm,0,@inputdate),0)) – CASE DATENAME(dw,DATEADD(ms,-3,DATEADD(mm,DATEDIFF(mm,0,@inputdate),0))) WHEN ‘SUNDAY’ THEN 2 WHEN ‘SATURDAY’ THEN 1 ELSE 0 END print @LastmonLastBusinessDay… (0 comment)

Deleting duplicate rows in SQLServer is very simple. Example : Check this table let me call it as Sample, order number 1,2 & 3  have identical values. Now we need to delete the duplicate rows.   Step 1 : Insert another column in table Sample called  Dup of type Integer. Step 2 : Execute this Query… (0 comment)

There are many Free and Better alternatives for list mentioned below. I like them because they make my life simple. Microsoft 1. Windows 2. Office (Word, Excel, Outlook, Power point, Access) 3. Visual Studio 4. Notepad 5. Microsoft Shared View 6. Microsoft Security Essentials 7. Snipping Tool 8. SQLServer Google 1. Search 2. Gmail 3.… (0 comment)

  Based on http://www.sqlbook.com/SQL/Avoiding-using-SQL-Cursors-20.aspx with a minor change. DECLARE @CustomerID int DECLARE @FirstName varchar(30), @LastName varchar(30) — declare cursor called ActiveCustomers DECLARE ActiveCustomers Cursor FOR  SELECT CustomerID, FirstName, LastName   FROM Customer  WHERE Active = 1 — Open the cursor OPEN ActiveCustomers — Fetch the first row of the cursor and assign its values into variables… (0 comment)