SQL SERVER – UDF – User Defined Function to Find Weekdays Between Two Dates

Following user defined function returns number of weekdays between two dates specified. This function excludes the dates which are passed as input params. It excludes Saturday and Sunday as they are weekends. I always had this function with for reference but after some research I found original source website of…
Read More

SQL SERVER – Fix : Error : Msg 7311, Level 16, State 2, Line 1 Cannot obtain the schema rowset DBSCHEMA_TABLES_INFO for OLE DB provider SQLNCLI for linked server LinkedServerName

You may receive an error message when you try to run distributed queries from a 64-bit SQL Server 2005 client to a linked 32-bit SQL Server 2000 server or to a linked SQL Server 7.0 server. Error: The stored procedure required to complete this operation could not be found on…
Read More

SQL SERVER – Download SQL Server Management Studio Keyboard Shortcuts (SSMS Shortcuts)

Download SQL Server Management Studio Keyboard Shortcuts I have received many emails appreciating my article Query Analyzer Shortcuts and requesting same for SQL Server Management Studio Keyboard Shortcuts. I see frequent downloads of the PDF generated by SQLAuthority for the same on server. There is original article on MSDN site.…
Read More

SQL SERVER – FIX : ERROR 1101 : Could not allocate a new page for database because of insufficient disk space in filegroup

ERROR 1101 : Could not allocate a new page for database because of insufficient disk space in filegroup . Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup. Fix/Workaround/Solution: Make sure there is…
Read More

SQL SERVER – User Defined Functions (UDF) to Reverse String – UDF_ReverseString

UDF_ReverseString UDF_ReverseString User Defined Functions returns the Reversed String starting from certain position. First parameters takes the string to be reversed. Second parameters takes the position from where the string starts reversing. Script of UDF_ReverseString function to return Reverse String. CREATE FUNCTION UDF_ReverseString ( @StringToReverse VARCHAR(8000), @StartPosition INT ) RETURNS…
Read More