﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / T-SQL  / Inserting TAB into string / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 23:49:08 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Inserting TAB into string</title><link>http://www.sqlservercentral.com/Forums/Topic798676-8-1.aspx</link><description>[font="Arial"]I add the same problem with SQL Server :  "something"+char(9)+"something"returns something something "something"+char(9) + char(9)+char(9)+char(9)+char(9)+char(9)+"something"returns something somethingfinally, I "cheated" with : [b] "something"+char(9)+char(160)+char(9)+char(160)+char(9)+char(160)+char(9)+char(160)"something"[/b][b]returns something [8 spaces here]        something [/b] (each char9 or char16 is replaced by a space)so visually I got what I wanted, even if I admit it is not very elegant...[/font]</description><pubDate>Wed, 13 Mar 2013 04:44:49 GMT</pubDate><dc:creator>emich11-reseau</dc:creator></item><item><title>RE: Inserting TAB into string</title><link>http://www.sqlservercentral.com/Forums/Topic798676-8-1.aspx</link><description>[quote][b]RD-201664 (10/6/2009)[/b][hr]select 'there should be a tab between here' + char(9) + 'and here'Ideas?[/quote][code="sql"]declare @result varchar(100)set @result = 'TEST START'+char(9)+'EXEC'+char(9)+'TEST END'select @result[/code]RESULTTEST START	EXEC	TEST END[code="sql"]set @result = replace(@result,char(9),' -TAB HERE- ')select @result[/code]RESULTTEST START -TAB HERE- EXEC -TAB HERE- TEST END</description><pubDate>Tue, 06 Oct 2009 21:26:56 GMT</pubDate><dc:creator>arun.sas</dc:creator></item><item><title>RE: Inserting TAB into string</title><link>http://www.sqlservercentral.com/Forums/Topic798676-8-1.aspx</link><description>Ahh, I was only looking in QA then copy/paste to Notepad.  The finished output does have the tab.Thanks.</description><pubDate>Tue, 06 Oct 2009 11:06:21 GMT</pubDate><dc:creator>RD-201664</dc:creator></item><item><title>RE: Inserting TAB into string</title><link>http://www.sqlservercentral.com/Forums/Topic798676-8-1.aspx</link><description>What are you using to verify that you only get a space?  You're not going to see it in QA or SSMS, as they don't show things like carriage returns/tabs/etc.  If you select that cell into a front end that does display those things, it may work fine.</description><pubDate>Tue, 06 Oct 2009 10:56:43 GMT</pubDate><dc:creator>Garadin</dc:creator></item><item><title>Inserting TAB into string</title><link>http://www.sqlservercentral.com/Forums/Topic798676-8-1.aspx</link><description>Hi all,This is for SQL 2000.  I am trying to add a tab character to a string using char(9) but all I get is a single space.Example:select 'there should be a tab between here' + char(9) + 'and here'Ideas?Thanks.</description><pubDate>Tue, 06 Oct 2009 10:40:39 GMT</pubDate><dc:creator>RD-201664</dc:creator></item></channel></rss>