I am new to Hibernate and I need help/answers for few doubts.
1) I am using Oracle 10g dialect and If I use Session.CreateSqlQuery("Oracle syntax SQL Query");
My Question: If I change my dialect to SQL Server 2008. will the query which I have created by using CreateSqlQuery() changes/run's on SQL server 2008.?
or Do i need to change the Query once again.
Thanks & Regards,
Anand.
You need to specify the dialect of SQL server 2008.
It is database dependent.You cannot use same dialect for both databases
Related
In the Oracle database we had extensively used WITH clause in earlier project.
Now we are on SQL Server 2008 database. Do you suggest we can still use the WITH Clause in our SQL codes ? Does SQL Server 2008 support WITH clause ?
I mean does it improve the performance or does using WITH affect query performance in SQL Server 2008 ?
You can read more about it here:
https://learn.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql
and here:
https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table
Depending on what it is you were specifically looking at.
Performance is very much dependent on what it is you are doing, you would need to post some examples.
How can I use in query SQL file from Oracle SQL Developer, syntax like as MSSQL "USE DATABSE GO" for direct connect to an Oracle database.
Thanks!
Oracle introduced the multitenant Database in version 12c. It's structured similar to a MSSQL instance. If you are in that version, you can switch between pluggable databases with the following:
ALTER SESSION SET container = pdb1;
If you are on 11g or previous or on a non-cbo 12c Database, I don't see the way to switch to another instance.
is there any possibility to create a database or table with "in-memory" option using SQL Server 2012?. I've been reading about that and I can use that option but working with SQL Server 2014 and still don't know if 2012 is capable to do that.
Anny help appreciated
No, the In-Memory Optimization was introduced with SQL 2014.
I want to use SQL Server 2005 Express as database. Will NHibernate be supported with it?
Yes. Use:
Driver - NHibernate.Driver.SqlClientDriver
Dialect - NHibernate.Dialect.MsSql2005Dialect
It seems it is supported.
A tutorial ( https://web.archive.org/web/20130926011158/http://www.svendtofte.com/serverside/setting-up-nhibernate-20/ ) goes over setting up NHibernate and uses SQL Express 2005
I never seen this, but is it possible to have one SQL call join data from Oracle and SQl Server?
Yes, Oracle and SQL Server both have functionality that allows to connect to other databases, including different vendors. In Oracle terminology, it's a database link instance while on SQL Server it's called a Linked Server instance.
The syntax to reference the instance is different between Oracle and SQL Server though. IE:
Oracle:
SELECT t.*
FROM table_name#database_link_instance t
SQL Server:
SELECT t.*
FROM linked_server_instance_name.database_name.schema_name.table_name t
does MySQL support the linked server concept?
No, the closest MySQL has is the FEDERATED engine, which is only for connecting to remote MySQL instances.
PostgreSQL?
PostgreSQL has dblink. Last time I looked at dblink (pre-v9 release), it only could connect to other PostgreSQL instances.
Yes- both Oracle and SQL Server support the linked server concept. That allows you to reference the other server using a 4 part name. For example:
select *
from LocalDb.Schema.Table
cross join
OracleLinkedServer.RemoteDb.RemoteSchema.RemoteTable