It's really not clear what you are trying to accomplish. Are you trying to replicate the Information_Schema.Columns view? How about providing sample data and expected results as recommended in the Forum Etiquette http://www.sqlservercentral.com/articles/Best+Practices/61537/?
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA