Need syntax on Dynamic SQL

I am trying to write a SQL which would generate SQL based on table name and column provided. The SQL should ask for tname and colname and after that it would generate a SQL. Sample of the SQL would be select * from tname where colname is NULL (say for example).