Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
elwoos
Master Smack Fu Yak Hacker
2052 Posts |
Posted - 2004-10-11 : 05:44:03
|
Can you pass a recordset/table function/Select statement results into a stored procedure?I want to write a stored procedure that will work on a set of records. So what I want is something like this CREATE PROCEDURE my_sp @Input SETOFRECORDS -- this is the bit I am unsure aboutASUPDATE myTable SET myField = Value Where MyOtherField in (SELECT YetAnotherField from @INTPUT)Is this possible? Should I use a temp table? Is there not a better way?thankssteveTo alcohol ! The cause of - and solution to - all of life's problems |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2004-10-11 : 06:35:56
|
| I'd say yes, create a temp table and let the procedure work on that temp table. That will cause you the least amount of grief. |
 |
|
|
elwoos
Master Smack Fu Yak Hacker
2052 Posts |
Posted - 2004-10-11 : 06:49:42
|
| Thanks, I think I was leaning that way but thought there may be a more elegant solutionsteveTo alcohol ! The cause of - and solution to - all of life's problems |
 |
|
|
|
|
|