Hi every body
when i ran this code in sql server 2005
test"use
go
create
proc testProc @s nvarchar(100),@t
nvarchar(100)As
begin
select @s from @tend
go"
i encountered this error message
"Incorrect syntax near '@t'."
what is wrong in my code
by thanks
Javaneh

Stored procedure
-Codeman-
so thanks friends
I'll try them
thanks again for your guidances
Mike Husar
MarksmanWaugh
Hi Roji
so thanks for your help
I got it
Paulaps
Well, you gotta read
http://www.sommarskog.se/dynamic_sql.html
ramexx
Hi
You need to constract a string that can be executed by EXEC . Replace your
select @s from @t
with
EXEC ('select ' + @s + ' from ' + @t )
NB.