Thanks for your reply. But are these temp tables private to the
transaction? If I have 2 transactions running concurrently, and each of
them calls the procedure and create the temp table, and then do
something that runs the trogger, will their temp tables be separate an
isolated? Since I'm cretaing my transaction in an app server with
connection pooling, I have no control over the connection or batch. I
can only control transactions, so this methos can help only if temp
tables are private to the transaction within which they are crated.
Thanks,
HSA
[quoted text, click to view] Jens wrote:
> See the below example to see how to share data between these
> procedures:
>
>
> DROP TABLE SomeTable
>
> GO
>
> CREATE TABLE SomeTable
> (
> SomeColumnInt INT
> )
>
> GO
>
> CREATE TRIGGER TRN_SomeTable_Ins ON SomeTable
> FOR INSERT
> AS
> BEGIN
> SELECT 'From within the trigger -->' + SomeColumn
> FROM #Temptest
> END
>
> GO
>
> DROP PROCEDURE SomeProc
>
> GO
>
> CREATE PROCEDURE SomeProc
> AS
> BEGIN
> CREATE TABLE #Temptest (SomeColumn VARCHAR(200))
> INSERT INTO #Temptest VALUES ('Testdata Accessible')
>
> INSERT INTO SomeTable VALUES(1)
> END
>
>
> EXEC SomeProc
>
> HTH; Jens Suessmeyer.
>
> ---
>
http://www.sqlerver2005.de > ---