Re: Using temporary table in in dynamic SQL
From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 09/09/04
- Next message: james: "decimal data type multiplication"
- Previous message: Kevin Doyle: "Re: Function to compute the number of years?"
- In reply to: Jonathan Blitz: "Using temporary table in in dynamic SQL"
- Next in thread: JT Lovell: "Re: Using temporary table in in dynamic SQL"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 02:53:20 +0530
you can not reference a table variable inside dynamic sql , if the variable
is defined ouside the scope of dynamic sql statement.
ex:
declare @var table (idd int)
exec ('select * from @var') --error out, because @var is defined outside the
scope.
exec ('declare @var table (idd int) insert into @var values (1) select *
from @var') --successful
-- Vishal Parkar vgparkar@yahoo.co.in | vgparkar@hotmail.com
- Next message: james: "decimal data type multiplication"
- Previous message: Kevin Doyle: "Re: Function to compute the number of years?"
- In reply to: Jonathan Blitz: "Using temporary table in in dynamic SQL"
- Next in thread: JT Lovell: "Re: Using temporary table in in dynamic SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|