SQL SERVER – UDF – Remove Duplicate Chars From String

Few days ago, I received following wonderful UDF from one of this blog reader. This UDF is written for specific purpose of removing duplicate chars string from one large string. Virendra Chauhan, author of this UDF is working as DBA in Lutheran Health Network. CREATE FUNCTION dbo.REMOVE_DUPLICATE_INSTR (@datalen_tocheck INT,@string VARCHAR(255))…
Read More

SQL SERVER – 2005 Collation Explanation and Translation – Part 2

Following function return all the available collation of SQL Server 2005. My previous article about the SQL SERVER – 2005 Collation Explanation and Translation. SELECT * FROM sys.fn_HelpCollations() Result Set: (only few of 1011 records) Name Description Latin1_General_BIN Latin1-General, binary sort Latin1_General_BIN2 Latin1-General, binary code point comparison sort Latin1_General_CI_AI Latin1-General,…
Read More

SQL SERVER – Fix : Error : Server: Msg 131, Level 15, State 3, Line 1 The size () given to the type ‘varchar’ exceeds the maximum allowed for any data type (8000)

Error: Server: Msg 131, Level 15, State 3, Line 1 The size () given to the type ‘varchar’ exceeds the maximum allowed for any data type (8000) When the the length is specified in declaring a VARCHAR variable or column, the maximum length allowed is still 8000. Fix/WorkAround/Solution: Use either…
Read More

SQL SERVER – Repeate String N Times Using String Function REPLICATE

I came across this SQL String Function few days ago while searching for Database Replication. This is T-SQL Function and it repeats the string/character expression N number of times specified in the function. SELECT REPLICATE( ' https://blog.sqlauthority.com/ ' , 9 ) This repeats the string https://blog.sqlauthority.com/ to 9 times in…
Read More