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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Tmp Tables

Author  Topic 

Clages1
Yak Posting Veteran

69 Posts

Posted - 2008-06-24 : 14:34:16
Hi,
I have a Program that calls a dec_sfa735 (Stored Procedure) see below
this SP create a Table Dectmp735, after that a Crystal reports Rpt is
opened using this dec_sfa735 table.

i would like to know what happen when two users call the same Program at the same time.

att

C. lages



CREATE PROCEDURE [dbo].[dec_sfa735]
TRUNCATE TABLE Dectmp735
insert into Dectmp735
select field1, field2 from tablex

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-25 : 01:41:31
Better to use a temporary table if you want it to be used only using inside a stored procedure.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-25 : 09:58:51
Yes. Make use of temporary tables. Otherwise you may face locking issue also

Madhivanan

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

Clages1
Yak Posting Veteran

69 Posts

Posted - 2008-06-26 : 07:14:58
Ok , but how can i use tmp table in Cristal reports?
in other words when i am designing the reports i have to say
table name , column, etc.
if the tmp table does not exist yet. how can i do it?
tks
Again.

Clages
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-26 : 07:20:50
cant you specify stored procedure as source for crystal reports? and create this temporary table and populate it inside the procedure?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-26 : 09:31:54
<<
cant you specify stored procedure as source for crystal reports?
>>

It can be

Madhivanan

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

dmcknight5
Starting Member

8 Posts

Posted - 2008-06-26 : 10:25:32
Clages1,

Temp tables will do the job for you. If you not familiar on how to set the source of your reports to stored procedures. I listed the instructions for you below.

Just open up a new report in Crystal Reports and go to 'Create New Conncections' and from there expand you 'ODBC (RDO)' folder. Then choose you desired database. You should then be prompted for login information. Afterwards, expand the database options, and you should see the tables, stored procedures, etc and select the desired sp you need.

However, if you have to use a physical table, you might want to put a check there to check to see if the table already exist before you truncate it.

Go to Top of Page
   

- Advertisement -