Tag Archives: Server
Pivoting Data in SSRS – SQL Server
Consider we have table like Declare @table Table ( Name varchar(100), Year int, Factor int ) insert into @table values (‘Lucky’,2001,12) insert into @table values (‘Lucky’,2002,13) insert into @table values… Read more
Difference between Len and DataLength – SQL Server
declare @a varchar(100) = ‘a ‘ declare @b int = 12 select LEN(@a) [LEN A],LEN(@b) [LEN B] select Datalength(@a) [DataLength A],Datalength(@b) [Datalength B] LEN A LEN B ———– ———– 1… Read more
Find number of days in a month – SQl Server
DECLARE @d DATE SET @d = ’3-May-2010′ SELECT DATEADD(d,1 – DAY(@d),@d) AS [CURRENT MONTH FIRST DAY], DATEADD(m,1,DATEADD(d,1 – DAY(@d),@d)) AS [NEXT MONTH FIRST DAY], DATEDIFF(d,DATEADD(d,1 – DAY(@d),@d),DATEADD(m,1,DATEADD(d,1 – DAY(@d),@d)))… Read more
OpenRowSet – SQL Server
some times its required connect to a different source like some external access file or Excel file from SQL server. To accomplish this task we can use SSIS or .NET… Read more
CLR integration in SQL Server
Sometimes writing some code in C# is very easy as compared to SQL. Examples are recursion, handling datetime functionality like day light saving and many more. So for that we… Read more