6
Answers

Issue in selecting data from SQL Server 2008

Sreenath G

Sreenath G

13y
1.8k
1
 

Hi,

I have a table in my SQL Server. I have copied all the data from an excel to table. When I am querying the data like this..

SELECT [App_Name],[Link],[Comments] FROM [App_Links] where Env_Ref_ID=1

and App_Name = 'O2' 

I am not getting the result. But I have O2 in my table when queries as  SELECT [App_Name],[Link],[Comments] FROM [App_Links] where Env_Ref_ID=1

 

Issue is Column App_Name has got some space or other special characters it seems. I even tried with this..

SELECT [App_Name],[Link],[Comments] FROM [App_Links] where Env_Ref_ID=1

and LTRIM(RTRIM( App_Name)) = 'O2'  order by Link

but was no use. When I tried to copy cell data it was like this 'O2  '.

Any suggestion son this please.

Thanks

Sreenath
Answers (6)