• OK, I see.  You should change that parameter name to @TableName, so it's clear what it is.  And are you looking for the Searchname only in the column naam?

    If so, this should work:SET @sqlCommand = 'SELECT * from '+ @dbname +' Where naam = ''' + RTRIM(@Searchname) + ''''

    BUT you are still vulnerable to SQL injection.  If you're the kind of person who doesn't like reading his own name in the news, please address this before you do anything else.

    John