July 5, 2006 at 4:32 pm
I ran below script in Query ananlyzer
insert into lookup_tbl values('L,l,L,l')
However When I ran
select * from Lookup_tbl
I get the following result.
L,l,L,l
In addition, I was able to add following 'Lall' into the DB using in-house application.
However, when I search for the string in the DB, even though data exists, I was not able to find the string in the DB. In fact, SQl returned me no results.
select name_preferred from person_tbl where name_preferred = 'Lall'
No result was returned. I am really puzzled. Can anyone help?
July 5, 2006 at 4:45 pm
I'm puzzled as well.
What's wrong with your resultset from Lookup_tbl?
What did you expect?
_____________
Code for TallyGenerator
July 5, 2006 at 4:49 pm
'
as a part of a string value, as for example ,
set @string = 'Burton'.
set @string = 'O'Toole'
set @string = 'O'
Toole'
'
set @string = 'O''Toole'
Because you were typing into the front end, the application treated your single-quotes as part of the data. To search for the string you entered, you would have to use:
select
name_preferred from person_tbl where name_preferred = '''Lall'''
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
July 5, 2006 at 4:55 pm
If that's a case I would suggest to get familiar with the syntax of the programming language before trying to use it.
BTW, it's not about only TSQL, it's about any language.
_____________
Code for TallyGenerator
July 7, 2006 at 7:53 am
And what better way of doing so than calling on the help of members of this community?
July 7, 2006 at 7:56 am
The apostrophe trips up many a DBA. See discussion http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=145&messageid=290168
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply