July 7, 2006 at 10:54 am
Getting an error on the update statement.
Error: Must declare the variable '@TempTables'
July 7, 2006 at 11:01 am
When you use Dynamic SQL, you generate a new SPID and it cannot see the @TableVariable you have created... You may either have to use a physical table or create the table within your Dynamic SQL.
I wasn't born stupid - I had to study.
July 7, 2006 at 11:04 am
Ok, thank you for the info. Changed to a temp table and it works just fine.
July 10, 2006 at 4:53 am
Using dynamic SQL doesn't generate a new spid (session). It generates a new batch. Temp tables have session scope so they are visible to the new batch. Table variables have batch scope so they aren't.
re: spacing. Highlight the text and select 'Definition Term' from the Style dropdown. If it won't let you, change style to 'Normal' first, then change to 'Definition Term'.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply