<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Function Showing Whitespace - MSSQL Query</title>
	<atom:link href="https://mssqlquery.com/tag/function-showing-whitespace/feed" rel="self" type="application/rss+xml" />
	<link>https://mssqlquery.com</link>
	<description>MSSQL and TSQL Programming and TSQL Examples</description>
	<lastBuildDate>Fri, 10 Mar 2023 11:51:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.3.1</generator>

<image>
	<url>https://mssqlquery.com/wp-content/uploads/2023/06/cropped-mssql-query-icon-32x32.png</url>
	<title>Function Showing Whitespace - MSSQL Query</title>
	<link>https://mssqlquery.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Function Showing Whitespace in SQL Server</title>
		<link>https://mssqlquery.com/function-showing-whitespace-in-sql-server</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Sat, 23 Oct 2021 08:25:01 +0000</pubDate>
				<category><![CDATA[Functions]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Function Showing Whitespace]]></category>
		<category><![CDATA[Function Showing Whitespace in SQL Server]]></category>
		<category><![CDATA[Whitespace in SQL Server]]></category>
		<guid isPermaLink="false">https://mssqlquery.com/?p=162</guid>

					<description><![CDATA[<p>Hello to everyone, In this article, I will try to give information about the function that shows whitespace in SQL Server. There may be a need for whitespace detection in SQL Server in some cases. First, let&#8217;s learn what whitespace is. Contrary to popular belief, its meaning is not just&#46;&#46;&#46;</p>
<p>The post <a href="https://mssqlquery.com/function-showing-whitespace-in-sql-server">Function Showing Whitespace in SQL Server</a> first appeared on <a href="https://mssqlquery.com">MSSQL Query</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Hello to everyone,</p>
<p>In this article, I will try to give information about the function that shows whitespace in SQL Server.</p>
<p>There may be a need for whitespace detection in SQL Server in some cases.</p>
<p>First, let&#8217;s learn what whitespace is. Contrary to popular belief, its meaning is not just the space obtained by using the space character; At the same time, the spaces \n and \t obtained with escape characters are also whitespaces.</p>
<p>You can easily do this by using the function below.</p>
<pre class="line-numbers"><code class="language-sql">--Creating the function

CREATE FUNCTION [dbo].[ShowWhiteSpace] (@str varchar(8000))
RETURNS varchar(8000)
AS
BEGIN
     DECLARE @ShowWhiteSpace varchar(8000);
     SET @ShowWhiteSpace = @str
     SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(32), '')
     SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(13), '')
     SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(10), '')
     SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(9),  '')
	 SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(160),  '')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(1),  '[SOH]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(2),  '[STX]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(3),  '[ETX]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(4),  '[EOT]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(5),  '[ENQ]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(6),  '[ACK]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(7),  '[BEL]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(8),  '[BS]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(11), '[VT]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(12), '[FF]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(14), '[SO]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(15), '[SI]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(16), '[DLE]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(17), '[DC1]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(18), '[DC2]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(19), '[DC3]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(20), '[DC4]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(21), '[NAK]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(22), '[SYN]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(23), '[ETB]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(24), '[CAN]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(25), '[EM]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(26), '[SUB]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(27), '[ESC]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(28), '[FS]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(29), '[GS]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(30), '[RS]')
--   SET @ShowWhiteSpace = REPLACE( @ShowWhiteSpace, CHAR(31), '[US]')
     RETURN(@ShowWhiteSpace)
END


--Use of the function


SELECT dbo.ShowWhiteSpace('Hello MSSQL Users ')
</code></pre>
<p>&nbsp;</p>
<p>When you create the function and run the above code, you will see the following result.</p>
<p><img decoding="async" fetchpriority="high" class="alignnone wp-image-164 size-full" src="https://mssqlquery.com/wp-content/uploads/2021/10/function-showing-whitespace-in-sql-server-1.jpg" alt="Function Showing Whitespace in SQL Server" width="700" height="460" srcset="https://mssqlquery.com/wp-content/uploads/2021/10/function-showing-whitespace-in-sql-server-1.jpg 700w, https://mssqlquery.com/wp-content/uploads/2021/10/function-showing-whitespace-in-sql-server-1-300x197.jpg 300w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Here I pressed TAB and SPACE. The function showed me that I pressed the TAB and SPACE keys.</p>
<p>As you can see, we have made the whitespace detection.</p>
<p>Good luck to everyone in business and life.</p>
<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 468</span><span class='epvc-label'> Views</span></div><p>The post <a href="https://mssqlquery.com/function-showing-whitespace-in-sql-server">Function Showing Whitespace in SQL Server</a> first appeared on <a href="https://mssqlquery.com">MSSQL Query</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
