Posts

Showing posts with the label SQL Server 2012

T-SQL: Conver null or empty string to numeric value

I tried to use sum for a "varchar" type column in SQL table, and one day the code has error as there is a line contains empty value in this column and so the sum() function not working anymore. So I add following function NULLIF (<clumn>,0) The whole sum function is as below: sum(CAST(NULLIF(AMOUNT,0) AS DECIMAL(22,2))) Now I can get the sum amount value successfully.

Fixed "the microsoft ace oledb 12.0 provider is not registered" error when import data from Excel spreadsheet in SQL Server 2012

I try to import a Excel 2013 spreadsheet to SQL Server 2012 Database and received above error message. I installed below component "2007 Office System Driver: Data Connectivity Components" (https://www.microsoft.com/en-us/download/details.aspx?id=23734) and then try the import again. Works fine!

SQL Server 2012 AlwaysOn supports with Windows Azure Virtual Machines

Microsoft recently announced "SQL Server 2012 AlwaysOn supports with Windows Azure Virtual Machines". SQL Server 2012 AlwaysOn enables high availability and disaster recovery with SQL Server. It's a descendant of Database Mirroring and available only in SQL Server Enterprise. Any Database server that runs SQL Server 2012 Enterprise Edition can use AlwaysOn Availability Groups by joining a cluster and configuring the availability group.  It does not require shared disk storage, but requires special hardware and configuration steps to set up Failover Cluster Instances. For more information about these features, see Microsoft SQL Server AlwaysOn Solutions Guide for High Availability and Disaster Recovery .