View Single Post

   
  #1 (permalink)  
Old 02-29-2008, 06:40 PM
sean.gilbertson@gmail.com
 
Posts: n/a
Default Syntax of updating table variables?

Hi,

I have a user-defined function which returns a table (call it '@a'),
and has another table defined as a variable (call it '@b'). When I try
to do the following query, I get "Must declare the variable '@b'" and
"Must declare the variable '@a'." How do I remedy this?

The query:

UPDATE @a
SET
stuff =
(SELECT otherStuff From @b
WHERE @b.someID = @a.someID)

Reply With Quote