What is the Hibernate dialect for Microsoft SQL Server 2014? - sql-server

I have searched online but could not find the Hibernate dialect to use for Microsoft SQL Server 2014. Which dialect should be used?

The latest dialect for Microsoft SQL Server is SQLServer2012Dialect, which is the one you should use for now. See this link for all supported dialects.
Actually, there was a bug where Hibernate defaulted to the SQL Server 2000 dialect when SQL Server 2014 was used. This bug has been resolved (in versions 5.2.0 and 5.1.1) and the solution was:
Added version 12 to the switch statement so that SQLServer2012Dialect is now returned by default, as SQL Server 2014 is much more similar to SQL Server 2012 than SQL Server 2000
In time, a SQLServer2014Dialect will probably appear, which of course mean you would switch to that dialect then.

Related

SQL Server Managment Studio 2012 With Other Versions Of SQL Server

I know it might sound naïve but is there's anyway to use the SSMS 2012 with SQL Server 2008 as it's our deployment server but I really hate the absence of Intellisense SSMS 2008 and it makes me waste a lot of time that makes using the GUI much more reasonable option
You need to install SSMS 2012 from the installation media of SQL Server 2012. Or as an alternative you can download and use SSMS 2016, which is still in beta, but can be downloaded and updated separately from a database engine - https://msdn.microsoft.com/en-us/library/mt238290.aspx. It has all features of SSMS 2012 and more.
Yes, I've used SSMS 2012 and 2014 against our production 2008 and 2008R2 SQL server instances.
I have used SSMS2012 against multiple versions of SQL Server (2008R2, 2012 and even 2014) and I have not encountered any problems so far. Anyway, I expect to be fully backward compatible, so it should work fine with 2008R2.

Does FluentMigrator work with SQL Server 2014

Does Fluent Migrator not support SQL Server 2014?
I am getting below exception -
“The major version of the database server could not be determined or is not supported by FluentMigrator.”
Update: As of 2014-12-31 Fluent Migrator does support SQL Server 2014.
No, As of today (15.Dec.2014) Fluent Migrator doesn't support SQL Server 2014 version.
You can verify it in below wiki page.
https://github.com/schambers/fluentmigrator/wiki/Supported-Databases
Both yes and no. There is no explicit support yet but for 90% of features, it is the same code for Sql Server 2005, 2008, 2012 and 2014. If you specify the provider (see Command Line options here) as Sql Server 2012 then your migrations should work.
migrate --configPath "WithConnectionString.config" -conn "Test.Connection" --provider sqlserver2012 --assembly ".\Migrations\bin\Debug\Migrations.dll"
New features in Sql Server 2014 will not be supported but at this stage every new release of Sql Server contains few new features that affect FluentMigrator. For example, the only new features that Sql Server 2012 introduced and that affected FluentMigrator were sequences and clustered indexes. Here is the Pull Request for Sql Server 2012.
If there is a feature from Sql Server 2014 that you want support for then create an issue on Github!
EDIT: I installed Sql Server 2014 and tested that it works with the provider set to SqlServer2012. And it does!

How to change database engine in SQL Server

I am working in SSMS 2012. I recently discovered that 2012 built-in functions like TRY_CONVERT and DATEFROMPARTS are not recognized by my particular instance. So, I checked my database engine (at least, I think it's the engine I'm checking) via SELECT ##VERSION, and it returned Microsoft SQL Server 2008 (RTM) - 10.01.1600.22 (X64). If this is an engine problem (i.e., I'm not using the 2012 engine), how do I update / change the engine to the 2012 version?
I can see 3 factors as play here than can confuse you:
SSMS Version: SSMS is only the GUI to access SQL Server. Later version of SSMS can access earlier version of the SQL Server Engine. The fact that you are running SSMS 2012 doesn't mean you will get access to new functions in SQL Server 2012.
SQL Server Engine Version: I think this is your problem. The result you got clearly indicate it's 2008.
Compatibility level: you can run a newer SQL Server Engine as if it's an older one. So you can run SQL Server 2012 as 2008 or even 2005. In that case, even though you engine supports these new functions, the compatibility level prevents you from using them.
I think your problem is that you are accessing SQL Server 2008 through SSMS 2012. Get the proper version of SQL Server through MSDN, SQL Server Express (free) or DreamSpark( if you are a student).

SQL Server 2012 SSMS with SQL Server 2008 R2 database engine

I use SQL Server 2008 R2 as the database engine. With my MSDN subscription, I can get SQL Server 2012 for development use. Since I noticed some cool things in 2012 SSMS, my question is that if I only use 2012 SSMS and keep 2008 R2 as the database engine, will there be any difference in scripts' generation or any other effects?
Thanks.
UPDATE 1:
Oh yes, I saw this page: SQL Server Database Engine Backward Compatibility, but it is not exactly what I am looking for.
No, there should be no ill effects.
SSMS 2012 should generate scripts that are compatible with the database version that is being actively used.

SMO and Sql Server 7.0

Does anyone have a definitive answer to whether Sql Server Management Objects is compatible with Sql Server 7.0?
The docs state:
Because SMO is compatible with SQL Server version 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008, you easily manage a multi-version environment.
But trying to connect to a Sql 7 instance gets me:
"This SQL Server version (7.0) is not supported."
Has anyone been successful in getting these 2 to play nice?
you can use SMO to connect to SQL Server versions 7, 2000, and 2005, but SMO does not support databases set to compatibility levels 60, 65, and 70.
for SQL Server 7.0 the compatibility level is 70
Obviously this is conflicting information...I assume if your compatibility level of your DB is 70 you can not connect.
To check run: EXEC sp_dbcmptlevel 'databasename'
Looking through this link, it seems you might be able to change the compatibility level by running this:
EXEC sp_dbcmptlevel 'databasename', 80
Obviously make a back up before changing anything.
Looks like the docs are wrong (and have continued to be wrong for the last 3+ years!). I found this snippet with Reflector in Microsoft.SqlServer.Management.Common.ConnectionManager, Microsoft.SqlServer.ConnectionInfo
protected void CheckServerVersion(ServerVersion version) {
if ((version.Major <= 7 || (version.Major > 9)) {
throw new ConnectionFailureException(
StringConnectionInfo.ConnectToInvalidVersion(version.ToString())
);
}
}
So, it looks like only SQL 2000 and SQL 2005 are supported. Presumably, SQL 2008 (version 10) has updated SMO assemblies.
Bummer - guess it's back to SQL-DMO for this project.
Just to follow up on your commment SQL 2008 does have its own SMO package which supports SQL 2000, 2005 and 2008 which is actually definitively documented on their download page! And you're right you can't connect SQL 2005 SMO to SQL 2008.
There are some nice updates updates in Version 10 of the SMO in that if you access properties that do not existing on the version of SQL that you are connect to you get a sensible "This property is not available on this Version of SQL" exception or words to that effect.
Microsoft SQL Server 2008 Management Objects
The SQL Server Management Objects (SMO) is a .NET Framework object model that enables software developers to create client-side applications to manage and administer SQL Server objects and services. This object model will work with SQL Server 2000, SQL Server 2005 and SQL Server 2008.
Sorry for the late answer... there is partial support for SQL 2000 and SQL 7

Resources