declare @cwhere as varchar(1000) declare @csql as varchar(1000) set @cwhere = 'XXXXXXXX' set @csql = 'select * from tablename where ckeyfieldname = @cwhere' exec (@csql)I am losing me @cwhere variable when I evaluate the @csql string. BTW, this is a simple example of what I am trying to do only for example.