How to Retrieve the Column Name which has space in SQL Server

Use this simple code to find the name of those columns from the database which has spaces in their names.


FROM sysobjects o INNER JOIN syscolumns c ON = AND o.xtype = 'U'
WHERE ( = 'TableName') and like '% %'


Author: Mrs. Meetu Choudhary Nanda06 Jun 2009 Member Level: Gold   Points : 1

Please use proper resource category.
for this kind of code snippets use tips instead of code snippet.

Thanks and Regards
Meetu Choudhary

Author: Manoranjan Sahoo06 Jun 2009 Member Level: Gold   Points : 0

Ok. I will do from next time.

Thank You for inform me.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: