Very simple and very effective. We use all the time for many reasons – formatting, while creating dynamically generated SQL to separate GO command from other T-SQL, saving some user input text to database etc. Let us learn about T-SQL Script to Insert Carriage Return and New Line Feed in Code.
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 MoreSQL 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 MoreSQL SERVER – 2005 Row Overflow Data Explanation
In SQL Server 2000 and SQL Server 2005 a table can have a maximum of 8060 bytes per row. One of my fellow DBA said that he believed that SQL Server 2000 had that restriction but SQL Server 2005 does not have that restriction and it can have a row…
Read MoreSQL SERVER – 2005 – UDF – User Defined Function to Strip HTML – Parse HTML – No Regular Expression
One of the developers at my company asked is it possible to parse HTML and retrieve only TEXT from it without using regular expression. He wanted to remove everything between < and > and keep only Text. I found the question very interesting and quickly wrote UDF which does not use regular expression. Let us see how to parse HTML without regular expression.
SQL SERVER – 2005 Constraint on VARCHAR(MAX) Field To Limit It Certain Length
One of the Jr. DBA at in my Team Member asked me question the other day when he was replacing TEXT field with VARCHAR(MAX) : How can I limit the VARCHAR(MAX) field with maximum length of 12500 characters only. His Question was valid as our application was allowing 12500 characters.…
Read More