Hi Manjuke,
Try to construct the string dynamically and execute it. SQL Server will expect a single value for @Param.
declare
@Query as nvarchar(512), @spParam nvarchar(100)
Set
@spParam='''s'',''t'''
set
@Query = 'select * from sys.objects where type in ('+@spParam +')'
exec
sp_executesql @Query
Having said this, i need to tell that dynamic sql is ugly. It has a potential security threat through sql injection and can cause performance issues ona busy server.
G.R.Preethiviraj Kulasingham MCITP: DBA
http://preethiviraj.blogspot.com/
Plan Your Work and Work Your Plan!