| 
	
 | 
 Posted by Erland Sommarskog on 01/14/06 00:41 
serge (sergea@nospam.ehmail.com) writes: 
> Anyhow there's a single place where if i add dbo. in front 
> of the table this function which is being called from an SP, 
> when i run the SP from the QA or from the ASP application 
> it runs forever. As soon as i remove the dbo. again it runs 
> in 6-8 seconds. Here's the thing this same table reference exists 
> a few lines below in the 2nd UNION for example and 
> having a dbo. in front doesn't cause any problems. 
 
I assume that we can rule out that there are two tables with different 
owners, and you are logged in as that owner when you try this? Of course, 
since: 
  
> Even more confusing if i add Databasename.dbo.TableName 
> and run it again, i don't run into any problem. 
 
it's not very likely at all. 
 
But I'm afraid I don't have very many ideas. Did you study the query  
plan to see if they were identical in both cases? 
 
--  
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se 
 
Books Online for SQL Server 2005 at 
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx 
Books Online for SQL Server 2000 at 
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 
  
Navigation:
[Reply to this message] 
 |