Showing posts with label SQL Error. Show all posts
Showing posts with label SQL Error. Show all posts

Thursday, February 11, 2010

Experience with recovering a CRM database marked as SUSPECT

Unfortunately we had our CRM down because the CRM database was marked suspect in SQL. Had a tough time getting it back. Here we share our experience and the steps/commands that helped us get our system back up and running. These may not be the only way of fixing it and perhaps not everyone’s problem would be solved by following these but I hope some of the points below would perhaps get you closer to retrieving your data back.

- Stop the SQL server service.
- Go to Physical location of the suspected database and rename the database.
- Create new database of the same name to suspected database name.
- Remove the newly created database after this rename suspected database to original suspected database name
- Start the SQL server service.
- Open SQL server Management Studio and find “new Query”
- Click on new query , new command window will be open.(See below the screen)



- Select the master database.
- After that in command window type below the statements
o ALTER DATABASE SET EMERGENCY
o ALTER DATABASE SET SINGLE_USER
o DBCC CheckDB ('', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS
o ALTER DATABASE SET MULTI_USER

Once these commands are successfully processed the database would be available. Note that the DBCC statement above may result in some data loss if any part of the data is corrupt. But if you do not have a SQL backup for you to restore then this is the only option you have…
-------------------------------------------------------
Posted by: Inogic
For more information/discussions (documents, sample code snippets, detailed work flow or diagrams),
Please be free to visit the following links or email us:
Web: http://www.inogic.com
Blog: http://inogic.blogspot.com
Email: news@inogic.com
-----------------------------------------------------

Sunday, November 29, 2009

You receive an Sql Error when Importing Customizations

You may come across the following error when you try to import the customizations for an entity that already exists in the system.

This error is often a result of data type mismatch between the attributes in the new customization file being imported and the entity attributes already defined in CRM. Say for example an entity has an attirbute of the type picklist in CRM. However the same attribute is now defined to be of the data type int in the new customization file that needs to be imported. CRM allows for onyl unique attribute names. Now since it already has an attribute of the same name but a different data type it cannot overwrite that attribute with the new data type defined in the customization file.

To fix the problem, you need to delete the existing attribute from CRM entity. Publish the entity customizations. Now try to re-import the customization file. It will import without any SQL errors.