CRM Installation Error : Sql instance name must be the same as computer name

When the Sql server instance is differ from the machine name, this error will be given as a result of verification tasks under the system check of CRM installation. Most of the time this happens if the Sql server instance changes after the first installation and reinstallations.

CRM Installation Sql Error
CRM Installation Error

Anyhow this can be fixed easily as we can use few sql stored procedures. Follow the steps listed below.

Continue reading “CRM Installation Error : Sql instance name must be the same as computer name”

Advertisements

SQL Server function to get Business Unit Guid by Name

This will be very useful when you are migrating data to CRM database from some other system database. Specially when filling base tables we should give business unit guid to it.
You can use following function and I have given the way that you should use it in your data migration scripts.
CREATE FUNCTION dmfx_GetBusinessUnit
(   
    @businessUnitName nvarchar(30)
)
RETURNS TABLE
AS
RETURN
    SELECT [BusinessUnitId] AS BusinessUnit
    FROM [TEST_MSCRM].[dbo].[BusinessUnitBase]
    WHERE Name=@businessUnitName
GO
Use\Invoke the above function as follows…

INSERT INTO [TEST_MSCRM].[dbo].[TEST_regionBase]
      (
      [CPMS_regionId]
      ,[CreatedOn]
      ,[CreatedBy]
      ,[ModifiedOn]
      ,[ModifiedBy]
      ,[OwningUser]
      ,[OwningBusinessUnit]
      ,[statecode]
      ,[statuscode]
      ,[DeletionStateCode]
      ,[ImportSequenceNumber]
      ,[OverriddenCreatedOn]
      ,[TimeZoneRuleVersionNumber]
      ,[UTCConversionTimeZoneCode] 
      )
SELECT
     [GUID] as TEST_regionId]
      ,GETDATE() AS [Created]
      ,(SELECT DataMigrationUser FROM dmfx_GetDataMigrationUserId()) AS [CreatedBy]    —    Data Migration User
      ,GETDATE() AS [Modified]                           
      ,(SELECT DataMigrationUser FROM dmfx_GetDataMigrationUserId()) AS [ModifiedBy]    —    Data Migration User
      ,(SELECT DataMigrationUser FROM dmfx_GetDataMigrationUserId()) AS [OwningUser]    —    Data Migration User
      ,(SELECT BusinessUnit AS [OwningBusinessUnit] FROM dmfx_GetBusinessUnit(‘TESTBUSINESSUNIT’)) AS BusinessUnit     —   
TESTBUSINESSUNIT
      ,0 AS [statecode]
      ,1 AS [statuscode]
      ,0 AS [DeletionStateCode]
      ,null AS [ImportSequenceNumber]
      ,null AS [OverriddenCreatedOn]
      ,0 AS [TimeZoneRuleVersionNumber]
      ,null AS [UTCConversionTimeZoneCode]

FROM [EXISTINGDB].[dbo].[ClientRegions]