Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 stored proceduss crosstab

Author  Topic 

yguo1
Starting Member

3 Posts

Posted - 2007-10-08 : 16:34:20
I copied stored procedure "crosstab" into our sql server 2000. I successfully created it and call it from other stored procedure. But when lots of people use the application, ##povit table caused error. Error message is "There is already an object named '##pivot' in the database. ". I can not replace table #pivot with #povit in stored procedure crosstab. Any ideal will be great help.
Thank you in advance
Vicky

Kristen
Test

22859 Posts

Posted - 2007-10-08 : 19:50:08
##pivot is a global temporary table, so multiple users will "clash"

If the Sproc is using Dynamic SQL you could construct a ## table name using, for example, a GUID so that it is unique.

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-09 : 03:35:25
Alternate
http://weblogs.sqlteam.com/jeffs/archive/2005/05/02/4842.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

yguo1
Starting Member

3 Posts

Posted - 2007-10-10 : 17:13:27
Thank you very much. I used Alternate one. It works perfect.

quote:
Originally posted by madhivanan

Alternate
http://weblogs.sqlteam.com/jeffs/archive/2005/05/02/4842.aspx

Madhivanan

Failing to plan is Planning to fail

Go to Top of Page
   

- Advertisement -