Friday, March 23, 2012

read from a temporary table

Hi,
How can I reed a value from a temporary table from within a function?

Quote:

Originally Posted by tess1

Hi,
How can I reed a value from a temporary table from within a function?


Can you explain what you mean for temporary table?
Because for all tables same Query will acceptable.|||

Quote:

Originally Posted by hariharanmca

Can you explain what you mean for temporary table?
Because for all tables same Query will acceptable.


I have this function :
CREATE FUNCTION [DBO].[f1]
( )
RETURNS BIT AS
BEGIN
SELECT c1 FROM #xTemp
END

#xTemp has creeted before execute this function f1 and I cannot creat it within the function|||

Quote:

Originally Posted by tess1

I have this function :
CREATE FUNCTION [DBO].[f1]
( )
RETURNS BIT AS
BEGIN
SELECT c1 FROM #xTemp
END

#xTemp has creeted before execute this function f1 and I cannot creat it within the function


i think if you use them in the same transaction.you have no problem.of course if you must use two transaction then set the 'transaction isolation level' to ''dirtyread".|||No you cant access the temporary tables in functions

No comments:

Post a Comment