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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Getting Data With % Sign

Author  Topic 

vinodonline2000
Starting Member

1 Post

Posted - 2011-08-01 : 16:26:33
Hi All,

Is it possible to get data with % sign attached to it in Sql Server?

If yes how can i do this?

Vinod

vinod

Jason W
Starting Member

19 Posts

Posted - 2011-08-01 : 17:57:09
Hi Vinod,

You can use the % as a wildcard character with the LIKE clause. See below:
SELECT *
FROM tablename
WHERE tablecolumn LIKE 'ABCD%'

This would return a value of ABCDEFG if it existed.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-08-01 : 18:19:13
SET @s = 'var1' + '%'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -