AS --------------2
SET NOCOUNT ON ---------------3
declare @str varchar(20) --------------4
declare @strSQL varchar(200) ----------------------5
select * into #k from Animals -----------------6
CREATE TABLE #K3(A VARCHAR(25)) ----------------7
set @str='C%'
set @strSQL='select * from #k where Animals LIKE '+ '''' +@str+ ''' ' ----------------8
exec(@strSQL) -----------------9
INSERT INTO #K3(A) SELECT * FROM #K ---------------------------10
SET NOCOUNT OFF ------------------11
SELECT * FROM #K3 WHERE ANIMALS='CAT' -----------------12
RETURN --------------------------13