please give solution of the test SP below :
create procedure TestSP(@ExistTable nvarchar(128),@NewTable nvarchar(128))
as
begin
select * into @NewTable from @ExistTable
end
Error shows
"Msg 102, Level 15, State 1, Procedure TestSP, Line 5
Incorrect syntax near '@NewTable'."
if I use
create procedure TestSP(@ExistTable nvarchar(128),@NewTable nvarchar(128))
as
begin
select * into [@NewTable] from [@ExistTable]
end
Then SP creates but not execute and the error shows:
exec TestSP ('test2','test1')
"Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'test2'."
Please help me out.....