Inserting into table from cursor
Database
2
Posts
2
Posters
0
Views
1
Watching
-
Hello friends, I want to create a temporary table at runtime. After that a cursor will be called to fetch necessary records. I want to insert each of these records into a temp table. How a single stored proc will do this? Any help..
Amit
Presumably SQL server and I hope 2005 Declare @Tbl Table(Field1 int, Field2 varchar(20)) Insert @Tbl Select Field1, Field2 From SomeTable You now have a table var with your data - use a while or cursor to do your processing
Never underestimate the power of human stupidity RAH