Hi all, any help here would be appreciated. After spending an hour or two getting NHibernate to work I came across the error
(Toggle Plain Text)
Invalid object name 'dual'.
Can anybody shed light on what is causing this. The error occurs when updating/inserting into the DB. I'm using MySQL 2005 server and nhibernate 2.2 in vs2010. I'm new to databases so this has really stumped me. I've read that dual is an additional table generated by oracle but as I havnt called dual once within my code I'm unsure as to why I get the error or what it even is.
(Toggle Plain Text)
invalid object name 'dual'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'dual'.
Source Error:
Line 50: {
Line 51: trans.Rollback();
Line 52: throw ex;
Line 53: }
Line 54: }
DUAL does not exist with SQL server.
DUAL is only for Oracle.
There is no DUAL table in SQL Server. In fact, you don't need one in SQL Server, as you can have a SELECT statement without a FROM clause.
For example, consider the following SELECT statement in Oracle:
SELECT 'Something'
FROM DUAL
In SQL Server, the same result can be obtained by the following command:
SELECT 'Something'
If you are porting some code from Oracle into SQL Server and if you don't want to remove all references to DUAL table, then just create a DUAL table in your database using the following commands:
Bookmarks