Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Concatenating Apostrophe in string

Author  Topic 

homerjay80
Starting Member

26 Posts

Posted - 2007-03-20 : 14:17:50
Hello,

I'm trying to concatenate apostorphes in a select string

ex: select char(29)+column+char(29) from table

my result outputs with left padded spaces in query analyzer as 'Value '

I want my result to look like 'Value'

Is this correct way to go about this?

Thanks



spejbl
Starting Member

28 Posts

Posted - 2007-03-20 : 14:33:04
use RTRIM() function

Tom
http://suppline.com/
Go to Top of Page

homerjay80
Starting Member

26 Posts

Posted - 2007-03-20 : 14:33:34
Sorry, I'm using Char(39) not Char(29). Still having problem.
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-03-20 : 14:34:23
select '''' + Column_Name + '''' from tblYourTable

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

homerjay80
Starting Member

26 Posts

Posted - 2007-03-20 : 14:34:55
We have a winner, RTRIM.

Thank you very much :)
Go to Top of Page
   

- Advertisement -