As you already know that taking off from your busy life is very essential so I am taking off :):) Going on Holidays!!Will be back after 1 month so please visit my blog again for more new stuff in August!
Thanks for taking time to read my blog.
Namwar Rizvi
Arrays are one of the most popular data structures for several solutions. Unfortunately, SQL Server does not support arrays in TSQL. As an alternative, you can use Table variable or temporary tables as a work around for arrays. During my research about various possible approaches for array implementation, I found following article very [...]
Deleting a huge table like purging old transaction records of millions of rows takes quite a lot of time and since DELETE is a fully logged operation therefore, if something goes wrong during deletion the whole process will be rolled back which itself is a time consuming process.SQL Server 2005 enhanced the functionality of TOP [...]
Recompilation of the Query plan sometimes harms your server performance more than you expect. Prior to SQL Server 2005, SQL Server had the algorithm which may decide to recompile the full stored procedure because of just one statement. This strategy of full recompilation makes DBA life difficult because he/she needs to investigate the full stored [...]
Getting the last day of the month, for the given date, by TSQL is bit tricky. Following user defined function provides you a handy general purpose function to get the last day of the month.It gets the last day of the month as follows:For example we have a given date 17-March-2007
Add a month in the [...]
In SQL Server 205, Microsoft has introduced a new storage format for storing decimal values. This format is called vardecimal. This format addresses the issue of inefficient space management for the decimal and numeric data types.SQL Server uses the format (p,s) to decide about the space to allocate for a numeric or decimal data type [...]
In SQL Server 2000 there was no concept of SCHEMA. The ownership of the given object was maintained directly through user. Changing of the owenership could be performed by using the system stored procedure called sp_changeobjectowner.
Now, in SQL Server 2005 scenario has been changed. Objects are no longer directly linked to the user; [...]
Common Table Expressions or CTE are not just for writing more manageable queries. They are lot more than this, recursion is one of the features you can now use by CTE based queries. Remember your school days! Recursion is the solution of many complex or lengthy algorithms like factorial, finding employee hierarchy, finding parent nodes, [...]
Today I am sharing with you a utility UDF function to extract the file name from the given file path. This TSQL function also demonstrates the use of finding last occurance of a given character by using REVERSE function. Following is the TSQL code:
Create function dbo.udf_GetFileName(@m_FullFilePath varchar(255))Returns varchar(50)
as
Begin
ReturnReverse(Left(Reverse(@m_FullFilePath),Charindex(‘\’,
Reverse(@m_FullFilePath))-1))
End
Now lets test this function:
Select dbo.udf_GetFileName(‘C:\Program Files\Adobe\Acrobat5.0\Help\ENU\ACROBAT.PDF’)
[...]
Out of many good things I love following two great features in SQL Server 2005
SQL Server Dynamic Management Views or DMVs
SQL Server Reporting Services or SSRS
SQL Server 2005 exposes too much information about its internal working for a DBA to better tune the server but this information is hidden in different dynamic management views, counters [...]