Hi.I have a stored procedure using dynamic sql doing a simple inner join on 2 tables. I use dynamic variable table names as the table names will be passed from the user application and will change according to user request. The stored procedure below works if the number of table name parameters is always set to 2 but the number of joins between tables should also vary according to user request. So I would like to know if its possible to make the table name parameters in the stored procedure optional. I know this is possible if I was using variables for the arguments in a where clause use a case statement. here is my current stored procedurethanks Create procedure sp_OptionalParameters@Table1 varchar(128),@Table2 varchar(128)asdeclare @sql varchar(4000)select @sql = ' SELECT MySchema.[' + @Table1 + '].Column1, MySchema.[' + @Table1 + '].Column2, MySchema.[' + @Table1 + '].Column3, MySchema.[' + @Table1 + '].[Column4], FROM MySchema.[' + @Table1 + ']INNER JOIN MySchema.[' + @Table2 + '] ON MySchema.[' + @Table1 + '].Column1 = MySchema.[' + @Table2 + '].Column1 ' exec (@sql)GO