Hibernate mapping for decimal scale is wrong

When mapping a SQL table to a model using Hibernate or NHibernate, if you configure the mapping like following

<property name=”MyDecCol” type=”Decimal” precision=”28″ scale=”15″>
<column name=”MyDecCol” sql-type=”decimal” not-null=”false” />
</property>

For some reason, Hibernate/NHibernate will treat the field as a decimal with scale = 5 (5 decimal digits on the right side of the decimal separator). So if you save a value to this column with more decimal digits, it will be truncated to only 5 decimal digits.

I’m not sure why, but if you move the attributes to the inner column element, Hibernate and NHibernate will map the values correctly.

<property name=”MyDecCol” type=”Decimal”>
<column name=”MyDecCol” sql-type=”decimal” not-null=”false” precision=”28″ scale=”15″ />
</property>

Find /bin folder for SSRS integrated with SharePoint

SharePoint strikes again.

Follow the article http://blogs.catapultsystems.com/aroney/archive/2013/02/11/custom-dlls-with-sql-server-reporting-services-in-sharepoint-integrated-mode/

Normally, you can find the SSRS at C:\Program Files\Microsoft SQL Server\ MSRS10_50.SQLSERVER\Reporting Services\

If you want to find the folder for SSRS integrated with SharePoint, it’s not where it’s usually located but under the /15 hive, C:\Program Files\Common Files\Microsoft Shared\Web Service Extensions\15\Webservices\reporting\bin

Backup and restore data from production in sql server

Best is to use Excel as the export, import format.

Sometimes you need to change the design of the table(remove primary key, disable read-only, etc), to make it work.

select db, choose Tasks->export data, choose excel.

to restore, choose Tasks -> import data,
select the file and make sure the mappings are correct.