Oracle Dual table equivalant in SQL Server

In oracle we are using dual table name for the temporary purpose. which table we are using in SQL server

Questions by periyasamy

Showing Answers 1 - 1 of 1 Answers

gheibia

  • Mar 22nd, 2006
 

The SELECT command'S syntax in SQL Server is different than Oracle.In SQL Server you don't need (always) to select data from a source (using FROM).you can just select a variable.What SQL Server dose is return that variable's value as the result set.So, you can have a quary like this:declare @Myvar varchar(10)set @Myvar = 'AMIR'SELECT @Myvarbut in Oracle, you have to complete the SELECT command. So you need to have a FROM clause in your SELECT Command. But when you want to return a variable or constant using SELECT, you don't have any source table or view. That's why you use the dual table.SELECT 'AMIR' FROM dual;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions