Tag Archives: varchar

Encrypt With MD5, SHA Or SHA1 In MS SQL Server Posted by in SQL Server | Leave a comment

This article shows SQL statements that encrypt an input string by using MD5/SHA/SHA1 algorithm. And you should play with these SQL statements in the Microsoft SQL Server Management Studio (New Query) to see the results. Continue reading

Replace String With NText Or Text Data Type In MS SQL Server Posted by in SQL Server | 1 Comment

In MS SQL Server, there is a function called Replace which will replace all occurrences of a specified string value with another string value. And we can use this function in an Update SQL statement to change value of a particular column. However, if we replace a string in a ntext or text field, Replace() function doesn’t work and returns an error message: “Argument data type ntext is invalid for argument 1 of replace function.” or “Argument data type text is invalid for argument 1 of replace function.”. Continue reading