March 20, 2017

Quick tip: Checking the version of your Episerver Database

Just a quick post on this one. A friend was recently having problems trying to make updates to his local Episerver site via Nuget. Even after running updates to the DB via the package manager console (update-epidatabase), he was getting errors and he was concerned that there was a DB version mismatch between what he had and what the code was expecting.

(Note: he was trying to use the auto-create schema function in a version prior to when it was implemented.)

If, for whatever reason, you want to verify your DB version against what you should have for your code to work correctly, check the version for your DLL first and go to Episerver's nuget site, which has a handy Compare Database tool. Plug in values for the from/to that at least encompass your DLL version number. This will give you a list of DLL versions paired with DB versions, so you can see where changes to the database have been made.

Next, open up SQL Server Management Studio and connect to your DB server. Navigate the tree to [YourDB] > Programmability > Stored Procedures and execute dbo.sp_DatabaseVersion. The return value of this function will be the version for your DB.

A screenshot of Sql Server Management Studio running the Database Version stored procedure.

Compare and proceed accordingly.

1 comment:

Unknown said...

Good info, for the Commerce Db:

SELECT * FROM [dbCommerceManager].dbo.SchemaVersion order by 4 desc

Regards Luc Gosso