Last post Aug 09, 2012 10:36 AM by HTC asp
Aug 09, 2012 08:33 AM|mnmhemaj|LINK
I need to select a table data which has an ampersand symbol. when I run a select statement, the value got truncated at the & symbol.
For example Address field has the value P&V street.
select address from table
retruns only P not P&V street
Aug 09, 2012 08:55 AM|christiandev|LINK
Are you running this SQL statement in SSMS or is it inline SQL from your application?
Aug 09, 2012 08:59 AM|mnmhemaj|LINK
I am using this in an SQL statement in ASP.NET.
Aug 09, 2012 09:27 AM|christiandev|LINK
Can you post the code? I'm guessing the query returns the data, but the control you are assigning it to could be assigning the value wrong.
Aug 09, 2012 09:38 AM|mnmhemaj|LINK
The result is the same even if I run the query in SSMS. The data gets truncated at & symbol.
Aug 09, 2012 09:53 AM|sairam62.cse|LINK
select * from tablename where columnname like '%[&]%'
Aug 09, 2012 10:03 AM|mnmhemaj|LINK
my query looks like this:
select name, address from tablename where name like '%xyz%'
the filtering is not for address field.
Aug 09, 2012 10:07 AM|sairam62.cse|LINK
then what is the column .what kind of query u want tell
Aug 09, 2012 10:13 AM|mnmhemaj|LINK
The table looks like this:
Select * from table
where Name ='John'
The result must be
John P&V street
But my result is John P
Aug 09, 2012 10:20 AM|sairam62.cse|LINK
plz execute this query
declare @tt table(names varchar(100),address varchar(100))
insert into @tt(names,address) values('john','p&vstreet')
insert into @tt(names,address) values('baro','hlvstree')
select names,address,names+address from @tt where names='john'
Aug 09, 2012 10:28 AM|HTC asp|LINK
I Tried a Sample thing Like Your Code..
In My Table i Used few values with '&' but its working properly..
Its not getting truncated... You may have ccommitted some mistake in your application...
Check it out or put it here... Lets find a solution..
Aug 09, 2012 10:30 AM|sairam62.cse|LINK
are u telling me HTC asp
Aug 09, 2012 10:35 AM|HTC asp|LINK
I Was posting to mnmm...
Aug 09, 2012 10:36 AM|HTC asp|LINK