Check this...
http://msdn.microsoft.com/en-us/library/ms174123(SQL.90).aspx
And you can use if condition in your application code. Generate data set from the query to check the column using Information_Schema and take decission at application level code.
Stored Procedures are NOT supported in SQL Server CE.