Recently there was a requirement for me to get the first day of the current year. After banging my head here and there found following solution online and it works like charm.
MS SQL Server Management Studio and Dropbox
I was keep on getting following error few days repeatedly on MS SQL Management studio when I tried to execute lengthy Stored Procedures. But the funny thing is that it was running on other machines. Msg 10054, Level 20, State 0, Line 0 A transport-level error has occurred when sending the request to the server. […]
Calculating Week days in MSSQL
Had a requirement to calculate the weekdays between given date range (No of Days – Weekends). Finally with the help of WWW, I manage to figure out a way to do it in MS SQL DECLARE @START_DATE = ‘2012-09-17’ DECLARE @WEEKDAYS INT SELECT @WEEKDAYS = ( (DATEDIFF(dd, @START_DATE, GETDATE()) + 1) -(DATEDIFF(wk, @START_DATE, GETDATE()) * […]
Passing variable to SQL
I was helping my sister on VB.net and I wanted to help her to pass a variable to SQL command. It’s been so long since I studied VB.net. Later I managed to find out that we need to pass the variable as ‘“ & Variable_Name & ”’