Thursday, November 19, 2009

How to return data from a table column with white spaces.

Some time data table contains some records with with spaces in starting, if you trying to get all those records of that then you can use bellow mentioned queries.

1) SELECT * FROM table_name WHERE column_name LIKE ' %'

2) SELECT COUNT(*) FROM table_name WHERE PATINDEX(' %', column_name)>0

No comments: