Create temporary table at run time

Create temporary table at run time

  

Can i create database temporary table at runtime? Like in mysql:

Create temporary table....

Thsnk you


Solution

Sure, you would just need to do it in an Advanced SQL query.

J.Ja

Solution

Hello,

How to create a temporary table in Advanced SQL query? I applied similar syntax of SQL in Advanced Query as shown below :-

DECLARE @TempTable TABLE
(
ID INT IDENTITY(1,1) PRIMARY KEY,
CreatedDate DATE,
CustomerName NVARCHAR(100),
AttachmentStatus NVARCHAR(50),
Version INT,
EffectiveDate DATE,
ValidUntilDate DATE,
ApprovalStatus NVARCHAR(50)
)

But its showing an error "Unknown parameter used". 

I would highly appreciate if some one could give a solution.


Thanks in advance

 


Hi,

It is not an issue of creating temporary table but an issue of declaring an SQL variable that has the same syntax as parameters of Advanced SQL. Check this forum's thread and find the solution of this issue.

Regards

Tomasz

Hi Tomasz,

Thank you for your response. 

On other hand, I'm able to call a stored procedure in advanced sql but not a stored procedure with output parameter. Is there any way I can handle this scenario?

Thank you!