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
 how can i take this string?

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2006-11-10 : 05:42:53
Hi experts,
can you please tell me how can i insert the string
" india's currency is rupee "


this ' symbol is giving me problem while i'm inserting data into currency table.

thank you very much

Vinod

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-10 : 05:44:24
Replace single quote with two single quotes.

select 'india''s currency is rupee'


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2006-11-10 : 05:47:25
I think it gives the output like this

india s currency is rupee
what about this ' symbol there? is it not possible to take that?

Vinod
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2006-11-10 : 05:50:19
oh great thank you
it is giving the correct output thank you harsha
can you please tell me tha logic there?

Vinod
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-10 : 05:58:11
Logic is very simple.

Since quote character is normally used as string delimiter, to remove this special meaning attached to it, you need to suffix it with another quote character.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2006-11-10 : 06:00:36
okok
' is a delimiter so that it forgets the immiediate string.


thank you very much

Vinod
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-10 : 10:50:06
Select '','''','''''','''''''',''''''''''

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -