Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select statement

Status
Not open for further replies.

jianbo

Programmer
Dec 19, 2001
78
US
For a table such as tblA, it has two fields "name","status".
If I want to insert a record ("jianbo","I'm confused"), finally in database it becomes "jianbo","I''m confused".
Then I do a select "select status from tblA where name='jianbo' ", it will be "I'm confused" . But in one of my SQL2000 database, the result comes as "I\'\'m confused".
Who know where I can change this definition in SQL server?
Thanks.
 
you should

insert tbl select 'jianbo','I''m confused'
which will insert
I'm confused
for the second string.

Getting back
I\'\'m confused

looks like a client problem in that the string is being misinterpreted. That the \' looks like it was a problem in inserting the data and it has used \ as an escape character.


======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Thanks,nigelrivett.
It is not a insertion problem, it is still "I''m confused" in database.
Actually I found this problem when I first select this text string from database, then I want to do a update like "update tblA set .... where [status]='StrSelect' ", I got a error. I printed out this StrSelect and found it was "I\'\'m confused". While it is fine in browser, it still display like "I'm confused", my browser is IE6, maybe it can take handle of this type of identifier.
And I think this should be a problem with the database. Because I find in one of my SQL2000 server, it just give the normal "I'm confused" result, while another generate this problem.
 
Sorry,all
Get you mixed up here. I found it is actually a problem of my PHP setting. Not the SQL server problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top