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
 General SQL Server Forums
 New to SQL Server Programming
 anyone know how to do this?

Author  Topic 

codrgiii
Starting Member

29 Posts

Posted - 2010-11-02 : 11:25:43
How would i be able to delete the letter "ÿ" from being selected in a procedure?

For instance, say the result to my query in the SQL procedure returned something like "John19ÿ" how would i delete the "ÿ" and then make it look like "John19"?

Another question i have is, what would happen if the result was something like "Joÿn19", how would i be able to select that result up to the point of where "ÿ" starts so then it looks like "Jo"? For example-

declare @result varchar(12)
select @result = select name from table where second_name = 'smith'--the query returns @result as "Joÿn19"

--do something here that makes @result as "Jo"

select * from table where name like @result + '%'


Hope you all understand.

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2010-11-02 : 13:31:08
have a look at String Functions in BOOKS ONLINE( i.e. substring, char, charindex, patindex)

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-11-02 : 13:56:38
REPLACE(col,'ÿ','')

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx





Go to Top of Page

codrgiii
Starting Member

29 Posts

Posted - 2010-11-03 : 05:36:35
ty, the problem is now solved.
Go to Top of Page
   

- Advertisement -