Rebuild all indexes on all tables in the SQL Server database

Awesome post..

Basit's SQL Server Tips

One of the key tasks of a DBA is to maintain the database indexes and make sure they are not fragmented. You can use a sys.dm_db_index_physical_stats in a script to rebuild or reorganize indexes based on fragmentation. However, sometimes we may need to rebuild all indexes on all tables in the database, especially if you have to change any index property such as fill factor, compression, etc.

For this task, I wrote a following script that accepts parameters to change the properties of the indexes, and dynamically generate and execute ALTER INDEX statements. This script is compatible with SQL Server 2005 and above versions.

Here is this script:

View original post

Database list not found during MS CRM organisation import

Error: “Import organization wizard cannot connect to the SQL Server or cannot find an organization on “DB instance” MS CRM 2011 / 2013 / 2015 Deployment Manager” or “SQL Server is not connected please make sure that sql server service is running” or similar.

But strange thing is SQL server is running fine with some database.

Resolution: An organization with the same name ‘_MSCRM’ ending is not allowed. You can keep at max one database with ‘_MSCRM’ ending.

That’s it.

Enfource MS Dynamics CRM Deployment manager to keep same GUID during import

Many time we need to import organization in current MS CRM server from some other MS CRM server. When we import any organization, a new GUID for that organization will be created, but what if I want to keep same GUID in new environment … is it even possible?

Yes, it is. Here are steps for that…

  1. Click Start, click Run, type ‘regedit’, and then click OK.
  2. Locate and then click the following registry sub key: — HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  3. Right-click MSCRM, point to New, and then click DWORD Value.
  4. Name this DWORD value as ‘OptimizeOrgImport’
  5. Right-click ‘OptimizeOrgImport’, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. On the File menu, click Exit
  8. Restart the CRM web server before getting started with the Import process.
  9. That’s it.

Once this done every organization will have same GUID which is in older environment and important is, it wont allow to import same organization. To import same organization in same environment after implementing above registry entry either you have to delete the organization and reimport it with newer database or change ‘OptimizeOrgImport = 0’