Patrick,
>1 - I am searching for something in SqlServer that is similar to IIF in the Fox syntax. I need to retrieve a string via SqlExec from Sql-Server where one field should be composed by RTRIM(firstname)+RTRIM(Lastname) and in between a space "IIF" firstname is empty.
Others have pointed you to the CASE command in T-SQL, which can be used in the SELECT statement. In addition, you can create User-Defined Functions (UDFs) in SQL Server for functions, calculations, tests, and other conditional processing that you might want to reuse in multiple queries.
Dan Jurden's whitepaper takes you through the details of how to do that:
http://www.eps-cs.com/pdf/whitepaper_sqlUDFs.pdf